I am writing a web application in ASP.NET 3.5 that deals with some basic data entry scenarios. The application also includes a component that must constantly poll some data and perform actions based on business logic.
What is the best way to implement the polling component? It should run and check data every couple of minutes or so.
In the past, I saw several different options:
- The web application launches a background thread that will always execute while the web application is running. (The implementation I saw started the thread in the Application_Start event.)
- Create a Windows service that always works
What are the benefits of one of these options? Are there any additional options?
I am inclined towards the Windows service because it is split up and can work on another server (more scalable), as well as more control over its start / stop, etc. However, I feel that the compactness of having “background” logic running in the process of a web application can make the whole solution more understandable.
source
share