We want to implement caching in Azure for two main reasons:
- Speed up repetive data access
- Reduce stress on the database
Here are the characteristics of the data we are planning to cache:
- Relatively small (1 - 100 kb)
- Specific to each customer
- Not private, but we don't really want random people navigating through our entire cache
- XML or JSON
- Consumed by C# (i.e. not linked to directly in the html)
- Most weeks the data will not change, although some days the data could change several times
For this specific purpose Table storage appears better than Blob storage (we did just implement Blob storage for images, CSS, and JavaScript) and Windows Azure Caching appears better than Windows Azure Shared Cache (perhaps almost always better and the shared caching is mostly a legacy feature at this point).
The programming API of both appears straight forward. Compared to what we pay for cloud sites the cost of each seems to be negligible.
So far we are leaning toward Table Storage due to what we perceive to be the pros and cons of Azure Caching. As old .Net guys we are much more familiar with In-Memory Cache than NoSql style solutions:
Problems with Windows Azure Caching:
- If the VM is moved to a different server (by Microsoft for load balancing or whatever reasons) is the in-memory cache moved intact?
- We are guessing that whenever we publish changes to the cloud it wipes out the existing in-memory cache
- While the users rarely make changes to the cached data when they do make changes it is likely that they may make multiple updates within seconds and we are not sure how this is going to work with cache located across multiple nodes running web roles especially with increased traffic. (this is probably a concern with table storage as well!)
- Table storage appears like it will be easier to debug
Advantages of Windows Azure Caching
- somewhat faster