Thursday, March 05, 2009

Get in the Queue, your locks don't work here

Threading, locking and concurrency are all hot topics at the moment. One place where threading and locking don't work as a way of controlling access to shared resources are in distributed web applications. This blog entry by Tarn Barford discusses the use of Queues from IronPython (with plenty of example code) when working with web apps on the Azure platform.
I am, of course, talking about a pattern in high scale web application design, Queues. More specifically the Queue service on the Windows Azure cloud computing platform.
So when do you use Queues?

Its common to use thread synchronization objects in a web application to serialize access to a resource, but this thread synchronization approach doesn't work so well when you have multiple applications, over multiple servers competing for exclusive access to a global resource.

The first scenario I've found which suits the Queue service is in a user driven content ranking system. I suspect I'll find many more places to use the Queue services as I continue to learn more about developing and designing applications on the cloud platform.

In the web application I'm building I want users to be able to rate dynamic content and I also want to record the number of views. This is a very common concept which allows the users to provide feedback which can then be shared with other users and used to dynamically rank the content.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.