ASP.NET Application Architecture: Betting Practices for Long Background Processes?

I will try to be brief.

What is the best practice for calling a procedure from an asp.net web application that initiates a lengthy “background” process that needs to be started?

For example, I want to click a button on my webpage that says: “Run data conversion” (for example). This data conversion procedure can take 20-40 minutes, so it seems to me that I put all this code into an asp.net web page, this is not the way ... there is no need to run this background process through IIS. Sleeping service or application, etc., It seems like a way ...

The web application and background process will run on my dedicated Win2003 server, so I have many options, but which is better?

+4
source share
2 answers

There are many options, basically it comes down to the fact that you need some kind of process with which you can communicate. Options that I can come up with from the head; A web service running under a different application pool window service; command line process launched by your ASP.NET code.

The next question is how to communicate with another process. If you use a database, you can configure two common tables that both processes can access. The website places a job request in a table that the second process will control. Then, a second table could be used for the results that the website would control. Another option would be to use something like Windows Communication Foundation (WCF) or a .NET remote connection to send events between processes.

+1
source

If you are managing a server, I would suggest creating a Windows service - completely complete the task of converting data outside of ASP.NET; you will not want to restart ASP.NET halfway through the 40 minute conversion process.

+4
source

All Articles