1
votes

I have 2 instances of the webrole. Session are being stored on colocated cache in each of the 2 webroles.

Since I am using colocated cache, it means the information is local to each of the webroles. I wanted to know how does Azure track my sessions amongst the 2 instances of the web role. Somehow it is working because repeated requests to various webpages - which I am assuming is being handled by each of the 2 webroles, are not throwing up any error ie each webrole is somehow aware of my session. Does anyone know how does the local information get shares by Colocated cache?

1

1 Answers

3
votes

Well - if I understand you correctly - you're assumption that the cache is local to each of the web roles is not accurate.

Azure creates a distributed cache, across the two roles, which is used, collectively, by both roles. To put differently - each role accesses the data as if it was remote, being unaware where the data is actually stored, the cache implementation takes care of getting to the right data from the right place, and thus the session data is always available, no matter where the user's request lands.