Skip to main content

Posts

Showing posts with the label Azure AppFabric Cache

What cache mechanism to use from Windows Azure

Yesterday, I had a talk with one college about cache mechanism. The true is that Microsoft has a lot of cache mechanism and when we talk about Windows Azure we have so different mechanism that there are times when we don’t know what the best cache mechanism for us is. We will talk about 3 times of cache mechanism that are supported by Windows Azure: Windows Azure Appfabric Cache (specials service defined by Windows Azure) Co-located Role Caching (in-memory cache – resources are shared between cache and hosted applications) Cache Worker role (dedicate role used only for cache) From my perspective we have a lot of options. What we should know from the begging about Windows Azure Appfabric Cache is that be used in combination with Windows Azure of course, but from what I saw until now we cannot have a combination between co-located role caching and Windows Appfabric Azure Cache or Cache Worker role and Windows AzureAppfabric Cache. Why we cannot combine them? Because the last two cache me...

Windows Azure Cache - What are regions and tags and how we can used them

In the last post we talked about the new in-memory cache from Windows Azure. In this post I would like to talk about what are regions and tags. For what we know until now, we can define one or more named cache in the same cache “server”. Based on the cache name, we can point to that cache and used it. At this point you should know that we have a limit of 128 named cached for a given server. But I think that this number of named cache per deployment is enough for almost all scenarios. Each named cache can contains an “unlimited” number of regions. You can image a region as a container in a named cache. A named cache doesn’t need to contain a region. We need explicit create a region in a given named cache. Very important, because a region group cache items, a region is limited to a single cache host. Because of this regions are not supported in Windows Azure Shared Caching. Each item added to a region can contain a tag. Normally, an object that is added to a cache (without being added ...

AppFabric Cache - more than one writers in the same time

Intr-un post anterior am discutat despre AppFabric Cache, care are la baza mecanismul de DataCache pentru Windows Cache Server. Intr-un mediu in care avem mai multe masini care scriu pe acelasi cache trebuie avuta grija destul de mare la urmatorul caz: In acelasi timp 2 sau mai multe masini doresc sa scrie acelasi element in cache( aceiasi cheie). Cuvantul cheie la aceasta problema este "IN ACELASI TIMP". In mod normal am avea urmatoarea implementare pentru a scrie un obiect in cache: DataCacheFactory cache = new DataCacheFactory(); cache.Put(key,value); Totul ar functiona fara nici o problema pana cand 2 sau mai multe instante ar incerca sa scrie in acelasi timp un element cu aceiasi key in cache. In acest caz se arunca o exceptie de tip DataCacheException , cu error codul setat DataCacheErrorCode.RetryLater . Pentru a rezolva aceasta problema avem doua solutii, in functie de cat de probabil e sa apara un astfel de caz putem sa folosim una din solutii, sau o combin...

Could not load file or assembly 'Microsoft.Web.DistributedCache' or one of its dependencies. The system cannot find the file specified.

Încercam zilele acestea sa configurez AppFabric Cache pe o mașina. M-am trezit cu o eroare destul de interesanta la rulare: Could not load file or assembly 'Microsoft.Web.DistributedCache' or one of its dependencies. The system cannot find the file specified. Am verificat dacă Azure AppFabric este instalat, era okay, la fel și SDK-ul de Azure. Totul părea în regula pana m-am uitat la referințe. Referința pe care noi o aveam la Microsoft.ApplicationServer.Caching.Client.dll Microsoft.ApplicationServer.Caching.Core.dll era spre c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\AppFabric\Microsoft.ApplicationServer.Caching.Core.dll In momentul acela ceva nu parea in regula. AppFabric Cache 1.5 se afla in c:\Program Files\Windows Azure AppFabric SDK\V1.5\Assemblies\NET4.0\Cache\ și nu în cealaltă locație. Din cauza ca pe calculator a exista și versiunea vechie, căile nu au fost schimbate cînd s-a făcut update la noua versiune. Tot ce trebuie făcu...

Session on Azure AppFabric Cache

Într-un post anterior am prezentat pe scurt API la Azure AppFabric. http://vunvulearadu.blogspot.com/2011/07/azure-appfabric-cache-api.html Dupa cum ştim, în momentul în care punem aplicaţie web pe cloud, noţiunea de sesiune nu mai exista din cauza ca nu ştim dacă o sa ajungem la aceiaşi instanta a unui server intre doua apeluri succesive. Pentru a putea rezolva aceasta problema putem sa folosim Azure AppFabric. Dupa ce configuram Azure AppFabric trebuie sa adaugăm în web.config următoarea secţiune: <system.web> <compilation debug="true" targetFramework="4.0"> </compilation> <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider" compressionEnabled="false"> <providers> <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" ...

Azure AppFabric Cache API

Nu de mult a fost lansat CTP pentru Azure AppFabric Caching. In ultima perioada am început sa studiez API-ul acestuia mai în detaliu. O sa încerc în urmatoarele rânduri sa trec în revista API-ul acestuia si sa fac highlight la cea ce ii mai important. In primul rand este bine de stiut ca Azure AppFabric nu este totuna cu Windows Server AppFabric. Chiar daca cele doua se aseamana, acestea au assembly-uri diferite pe partea de client. Totodata nu avem posibilitatea sa facem switch intre Windows Server AppFabric si Azure AppFabric. API-ul care îl ofera Azure în acest moment nu este atât de larg, partea de notificari si regiuni înca nu este suportata în întregime. Am scris într-un post trecut modul în care trebuie sa se configureze Azure AppFabric. In momentul în care am configurat cache-ul în cloud, acesta ne pune la dispozitie sectiunea care trebuie sa adaugam în fisierul de configurare (aceasta v-a contine inclusiv token-ul de autentificare). http://vunvulearadu.blogspot.com/2011/03/out...