Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Microsoft Azure handle Session State?

Does anyone have any information on how state is managed in Azure when you choose to have multiple instances? It seems like InProc would be worthless and you would have to have another state server instance, or use the datastore to store the users state across servers.

Or does it implement sticky sessions, so InProc is all you need.

Found the answer here: Azure Forums

like image 794
Arron S Avatar asked Jun 21 '09 03:06

Arron S


3 Answers

Table Storage would be the most logical place. Other server farm type setups also use a database table to store session info.

Take a look at the AspProviders project in the Windows Azure SDK samples. It has a SessionState provider that uses Azure Table Storage.

like image 110
CoderDennis Avatar answered Oct 14 '22 17:10

CoderDennis


AppFabric Cache just went into production, and this is an excellent way to manage session data. In fact, it has a custom session state provider that simply drops into web.config. You'll find it in the Azure portal.

All info around cache sizes, pricing, and SLA is here.

Edit: Windows Azure Web Role templates now include the new ASP.NET Universal Providers, including a Session State provider that supports SQL Azure. Take a look at Nate Totten's blog post for more details.

EDIT 7/8/2012 Windows Azure now provides both a Cache Role and in-memory cache (both easily configurable with the latest tools and v1.7 SDK). The in-memory cache spreads cache across one of your existing roles instances, utilizing a set percentage of RAM (nice "free" option if you don't need much RAM in your app).

like image 39
David Makogon Avatar answered Oct 14 '22 16:10

David Makogon


Not requiring session affinity and thus using session state providers that rely on Azure storage or SQL Azure storage is the best choice.

For some legacy applications you may still need session affinity. For those cases, ARR between Azure load balancer and the Web farm is an option.

More details at http://go.archims.fr/hW54Xz

like image 40
Benjamin Guinebertière Avatar answered Oct 14 '22 16:10

Benjamin Guinebertière