c# - Web application + SQL server triggers / thresholds -


we have web application hosted in iis. in our database serves application have kinds of different data values. trying figure out way have email sent client if data value exists or exceeds threshold value.

generic example: have table lists widgets , 'in inventory' quantity. every time sells widget, quantity value depleted. want send email manager when widget quantity gets below 5 , tell him reorder more widgets.

we don't want have sql triggers check quantity time 'depletion' transaction takes place. instead, want type of background monitoring process checks level of widgets on timed basis. how can accomplish this? windows service / winform application? built iis run asp.net c# code?

polling based monitoring should last resort. uses many resources simple task , of time see it's not case anything. , doesn't scale when data grows.

instead, should focus on code changes values , act then, on in spot. , check lighter: 1 item being checked not all, , once, not every x seconds/minutes/hours/...

apart architectural considerations, answer question, jonathan said: can read database , send emails do, i'd consider windows service job because that's made for: background jobs running time, unrelated host users. benefits automatic startup , recovery options.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -