Session State Management

Posted by Gsrinivas under ASP.NET on 8/28/2009 | Views : 1696 | Status : [Member] | Replies : 4
When will we go for the sqlserver state mode and what are the advantages of using sqlserver state mode

Thanks
Srinivas




Responses

Posted by: Lakhangarg on: 8/28/2009 [Member] [Moderator] Silver

Up
0
Down
Hi Gsrinivas-

Why use SQL?

Once you start running multiple web servers for the same web site, the default asp.net session state, InProc, is no longer useful, as you cannot guarantee that each page request goes to the same server. It becomes necessary to have a central state store that every web server accesses.

SQL Server offers you centralized storage of a session state in a Web farm. It also offers the transactional capabilities that provide reliability to most relational database systems. You can use SQL Server to save a session. This process is not as efficient as InProc and StateServer mode, because you must store the information in a different process or on a different server. However, this option may be more efficient than using the aspnet_state service, depending on the actual workload and the database configuration. Once you start saving session state to a SQL database it will also persist through web server restarts and reboots.

For reliability you should consider storing session state for a web farm on a SQL cluster.

For More Details you can visit: http://idunno.org/articles/277.aspx
http://msdn.microsoft.com/en-us/library/ms178586.aspx

Thanks & Regards
Lakhan Pal Garg

Free Code Snippets
http://lakhangarg.blogspot.com/


Gsrinivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsrinivas on: 8/28/2009 [Member] Starter

Up
0
Down
hi lakhangarg

how can we differenciate it with the state server mode.

i mean that the state server mode is also available to multiple Web servers in a Web farm. so why do need to go for the sqlserver mode

thank you


Gsrinivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 8/29/2009 [Member] [Moderator] Silver

Up
0
Down
Hi-

as per my knowledge in case of State Server the value will be saved on the other server than the application and while hosting your application you need one application server and database server. so that is not a feasible solution (State Server) for each and every site..

But if you find any other reason please post here so that everybody can check this .

Thanks & Regards
Lakhan Pal Garg

Gsrinivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Virendradugar on: 9/3/2009 [Member] [MVP] Silver

Up
0
Down
Hi All,

Check out this article on code project which explains about session in ASP.Net. Different Types of Session,their Configuration. It Also describe Session on Web Farm , Load balancer , web garden etc.

http://www.codeproject.com/KB/aspnet/ExploringSession.aspx

Gsrinivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response