Recommended way to use sessions on Azure

I have read several articles that say it is recommended to use cache file for azure applications, while others say they use generic providers and use sql azure to store session state in sql azure table. Any experts please tell me which is better and why? The "why" is required, so I put forward my recommendation case. thank


source to share

2 answers

The cache has certain limits on transactions / hour, bandwidth / hour, and the number of concurrent connections. The transaction and throughput thresholds are equal to the hourly hour, so you must stay within these limits. Since the price is not linear, you can estimate your session usage and create a cache that is larger than you need, but that's just what you need to consider.

SQL Azure through generic providers will not have this limitation. I don't know your cache requirements, but if the cache is less than 100MB, you are now talking about a monthly $ 5 cache versus a $ 45 minimum for the Cache service. And if you need full space with 4GB of cache, 5GB of SQL Azure Cache will be significantly cheaper.

Having said it all: the cache provider has a specific purpose of use. For example: 4GB cache supports up to 12.8M transactions per hour or more than 3500 per second. Even a 128MB cache server provides over 100 transactions per second.

So: I would consider a solution with two main criteria:

  • If cost is a factor and you believe that cache transaction speed and data volume can be handled by SQL Azure, then SQL Azure is likely to be your best bet (and will scale well beyond 4GB max Cache). There is no published information on transaction speed around SQL Azure, but you can probably do some simple tests to see how many session beats you can push per second before you see degraded performance.
  • If your application requires very high transaction rates, targets posted to the cache indicate that Cache is the best solution. Note. You probably can't generate roughly 3,500 transactions per second against the cache from a single instance; rather, it is a multi-instance scenario.

For more information on cache specifics see here .

EDIT . Besides SQL and shared cache, you can set up your own dedicated cache using memory from existing roles (no cost to you) or the role of cache in your deployment (cost of any cost of role instances). This is the fastest option as it matches your deployment. It also supports memcached protocol. More information can be found here .



This good article describes the pros and cons of three different states of session management in Azure: Blue Sessions



All Articles