Question

I've seen examples of how to use optimistic and pessimistic models with Azure Caching (http://msdn.microsoft.com/en-us/library/windowsazure/hh914145), but I'm under the impression that these examples apply to managing Azure Caching concurrency between different roles or clients. I need to run multiple instances of a worker role and I want to know if I need to lock DataCache items when updating data, to prevent separate instances of the same role from interfering and possibly causing a DataCacheException to occur. Thanks for any input you can offer.

Was it helpful?

Solution

The examples apply to multiple instances of the same web/worker role too. Multiple instances mean distinct processes, which is pretty much the same as distinct roles or clients.

You may choose to lock the items. But that is orthogonal to running multiple instances, or multiple clients.

Note: Locks are expensive! You need to figure out the trade off depending on your scenario.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top