Reputation: 3716
From what I read, when session state is in SQLServer mode, it always has to access the DB to get and set Session variables. Is that true or can it use a cache in some situation ? If you have any good articles about how this mode works under the hood, please feel free to share them here. I just can't seem to find anything relevant on Google.
I'm trying to evaluate the risks of using this (performance, reliability, etc.)
Thanks !
Upvotes: 0
Views: 708
Reputation: 1656
Reliability: how reliable is your SQL Server instance? Is it clustered? Is it on a remote server?
Performance: SQL Server session state is one of the lowest performing session state option. I assume you are using this in an ASP.NET application and have more than one web server. For each request that requires session state, it will perform at least 1 database query. If session state is updated during the request, there will be one additional update query executed. In additional, everything stored in Session State will be read/updated. If you can be careful to limit which pages/resources require session state it may perform ok.
Alternatives: If you are only running on one web server, you could use State Server. If you need to support multiple web servers, you could consider using App Fabric Caching Session State provider or NCache. Both of these will perform better than SQL Server and are potentially more fault tolerant than SQL Server.
Upvotes: 2