Q34.Creating a Scalable Web Application with Background Processing in Windows Azure?

Most web applications accept requests from users and hand over the job of processing to a different component of the application. In Azure, Cloud applications web roles are the front end of the applications, accept requests and place these requests into a queue and worker role instances do the backend processing by polling the queue and pick up the queue item. Once a worker role has picked a worker item in the queue, other worker role instances cannot pick that item. This feature is built into the Azure queue service and results in a better performance as the tasks are split among the web role and worker role instances.

scalable web application with background processing

For example, in an Order Processing application, the web role instances which accept order details from end users, pass the order requests to Queues which hold these requests till they are picked up by the worker role instances for processing. In Cloud applications, multiple web role instances and worker role instances exist and this is done to facilitate acceptance of multiple simultaneous requests and ensure high response times. While processing an Order, the application uses Azure storage for persisting data.

The main advantage we get by splitting an application into different roles is that we can scale the roles independently. Cloud applications are designed to facilitate background processing of tasks by worker roles, while other components of the application are free to take up other tasks. In this example, while the worker roles are busy processing orders, web roles are free to accept new requests. It is the responsibility of the developers to arrive at the number of web role instances and worker role instances, so that the user is happy with the high response times of the application.

Important words:


Order Processing application


An Order Processing application is one which can accept orders placed by customers, process them and facilitate further action. In a high volume sales situation an order processing application should be able to receive large number of orders, process the orders and make the data available for other services.

Worker Item


Worker item is the information placed by web role in the queue. This worker item is picked up by the worker role for processing.