Offloading work to PHP Worker Roles on Windows Azure
There are many common scenarios in web development that require processing of information, gathering data, or handling message traffic that can be accomplished asynchronously – meaning in the background while the user is doing other things with the application. A common example of this is sending email or when thousands of users are posting comments on your blog. When you open an account or change your password, often web applications will send you some kind of confirmation email as part of the workflow. This is typically done from the server using SMTP relay. Anytime an application is connecting to an internal service there are times when network issues can cause problems. These problems range from slow bandwidth to high latency to server outages – each having the possibility to cause a connection timeout or just simply take a long, long time.
When doing this type of processing, you have two options: to “block” and process the message while the user waits on a response from the server, or to allow the user to simply carry on and queue the work for background processing. Windows Azure provides simple tools to make this type of background processing a snap.
To see how this can be done simply with the Windows Azure SDK for PHP and Eclipse, check out my new tutorial: “Tutorial - Using Worker Roles for Simple Background Processing”.
That's one more update for this week on the http://azurephp.interoperabilitybridges.com site (see others here).
I hope this is useful and I look forward to sharing many more tutorials and demos on simple ways to achieve powerful things with PHP and Windows Azure in the coming weeks.
Craig Kitterman, Sr. Interop Evangelist, @craigkitterman