We current move our existing web application to Azure. Azure Caching is very slow.
Is there any alternative caching mechanism (better than Azure Caching) for multi instances in Azure? For example, storing caching in Azure Storage or Azure SQL.
Thank you for your input!
Added
public class AzureCacheService : ICacheService
{
readonly DataCacheFactory _factory = new DataCacheFactory();
private readonly DataCache _cache;
public AzureCacheService()
{
_cache = _factory.GetDefaultCache();
}
public object Get(string key)
{
return _cache.Get(key);
}
public void Insert(string key, object obj)
{
if (obj != null)
{
_cache.Put(key, obj, new TimeSpan(3, 0, 0));
}
}
public void Remove(string key)
{
_cache.Remove(key);
}
}
*** Accessing ***
IoC.Resolve<ICacheService>().Insert(key, MyObject);
IoC.Resolve<ICacheService>().Remove(key);
In general, WA Caching is not slow, particularly if you turn on “local caching” (which should generally turn the latency down to around 0ms, as long as the data fits in memory). Memcached is another possibility: http://blog.smarx.com/posts/memcached-in-windows-azure.
You won’t find an order-of-magnitude difference in performance between WA Caching and Memcached, but in my experience Memcached is a little faster. Memcached won’t be able to beat the “local caching” feature in WA Caching, though, since there’s literally no latency on that. (It’s in-proc data access without serialization. Just about as efficient as is possible.)