views:

83

answers:

2

When building an ASP.NET MVC application with a goal of high availability, is it a good practice to keep the session state on the SQL Server, if there is no state server available?

A: 

I'd suggest AppFabric Caching (f.k.a. Velocity) instead.

Craig Stuntz
I need to work with an exisiting platform 2-3 web servers and a sql server.
Jay
Perhaps you should update your question to include all of your requirements, then.
Craig Stuntz
Incidentally, however, AppFabric Caching is designed to work with multiple web servers, and it's faster than both SQL caching and sticky sessions, so I'm not sure I see your objection.
Craig Stuntz
A: 

The point here realy is that you have 2-3 webservers like you mentioned in the comment to Craigs answer.

One way is to use SQL-server sessionstate which has its own problems http://idunno.org/articles/277.aspx.

If you have this one SQL-Server I would be carefull, because the DB for sessionstate will put heavy load on it. Each request will write to the db.

We use 2 webservers and a Loadbalancer that has sticky sessions. If your first request ends up in server 1 then all your requests are handled by server 1. (Its a bit more sophisticated but you get the idea.)

This might not allways be the best solution, but at least on our site (its a shop where user typically stay 20-30minutes) it works well. We use only little SessionState and have most of the userspecific stuff stored by the ProfileSystem. But I guess the ProfileSystem will also fail if requests go to different servers.

Malcolm Frexner