0

I am planning for a application which will be deployed on Windows Azure. The web role will have multiple instances. I see that with multiple instances in-proc session will not work.I see that I have following ways to manage my session

  1. Use Azure Storage

  2. SQL Azure

  3. AppFabric

I don't want to go with option 2 (SQL Azure).

Which option should I choose?

Update 1

I came across this post which demonstrates session affinity on Azure with Aplication Request Routing(ARR). How about going with this option, instead of above?

ajay_whiz
  • 17,573
  • 4
  • 36
  • 44

2 Answers2

6

AppFabric Caching Service, definitely. It will be live in 30 days, take a look on this link: Using the Windows Azure AppFabric Caching for Session State in order to see how to use it.

The table storage provider doesn't work very well, is just a proof of concept and should not be used in production code.

Keep the session state in SQL Azure is not supported by Microsoft. Besides, since there is no SQL Job Agent, you have to put the cleaning logic in your WebRole or in a separate Worker role.

vtortola
  • 34,709
  • 29
  • 161
  • 263
  • 1
    I agree - I wanted to use AppFabric caching for this on a project recently, but since it wasn't out yet I used Azure Storage (with a custom implementation - the default table storage provider is pretty sketchy) – Evan M Apr 20 '11 at 12:39
  • I think that is a mess. First you are gonna pay to put another role only to workaround the session thing, second it's still more difficult that the AppFabric Caching service. Session state has to be used with care, it's a killer in distributed applications, put deploy another machine on the cloud to be a bouncer so you can use InProc session state provider... is even worse :D – vtortola Apr 20 '11 at 15:13
4

I made open source project called Azure Providers on Codeplex that includes a session-state provider. The session-state provider stores the session data in the Windows Azure Table Storage. http://azureproviders.codeplex.com/

  • Does this session provider removes the entity on session end? – ajay_whiz Apr 20 '11 at 14:28
  • 1
    The information you added is NOT a good idea; also, keep in mind that the author of that ARR post explains that what he shows should be automated. He is right, because if you configure your webroles manually like that, they will lose configuration whenever they are recycled (which can happen for lots of expected - and unexpected - reasons). I do not see a reason not to go with SQL Azure, it works quite well. However, I would definitely check out the Azure Providers project Inge mentioned. – tijmenvdk Apr 21 '11 at 11:22