You have several options for solving this problem.
sql solution
table storage solution
memcache solution
Sql is a classic solution. Sql handles all sessions using classic sql queries.
Table storage works wonders (in my experience). It is really easy to scale and really simple to implement (just a few lines of code on your web server).
Memcache is the best solution. Azure provides a cluster of "cache servers" to store the session (or other serializable objects). It really scales easily and works really fast. I use this solution in my production environments with 0 problems and very good results.
To implement Memcache, you just need to add these lines to your web.config:
<configuration> <configSections> <section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere"/> </configSections> <dataCacheClients> <dataCacheClient name="default"> <hosts> <host name="YOUR_NAME_HERE.cache.windows.net" cachePort="YOUR_PORT_HERE"/> </hosts> <securityProperties mode="Message"> <messageSecurity authorizationInfo="YOUR_KEY_HERE"> </messageSecurity> </securityProperties> </dataCacheClient> </dataCacheClients>
Summary
If you don't care about costs and want to maintain the best performance, go to memcache solution. If you want your expenses to be really low, go to table storage.
source share