Last post Dec 29, 2010 03:03 AM by Stuart G
Dec 12, 2010 07:28 PM|xannen|LINK
In a case where I'd like to store a session on disk, what is the recommended means: through a database or simple a file (I'm thinking of use xml)?
I know that hardware impacts on the reliability and performance. Can someone explain which hardware is good for this situation, in terms of reliability and speed and performance?
Dec 13, 2010 01:41 AM|krisrajz|LINK
The most reliable is SQL. (but check tradeoffs!)
As far hardware is concerned, you have not mentioned volume of data to be transacted, volume of traffic, number of users etc.,
Dec 13, 2010 01:59 PM|atconway|LINK
For reliability I think SQL Server will trump an XML document just because of its robustness and feature set for holding and maintaining data. One
important note to consider when using an out of process storage option like a StateServer, SQLServer, XML Document, etc. is that all types must be serializable and marked with the "Serializable" attribute. It is easier to plan for this ahead
of time then going back to old applications that adhere and might have a non-serializable type that needs to be persisted within a more complex type (i.e. DataView, SQLCommand, etc.). For some more 'comparison' information check out this great MSDN article
which should help you decide on which method is best:
ASP.NET Wiki State Management Session:
Hope this helps!
Dec 29, 2010 03:03 AM|Stuart G|LINK
I think you can't really go past using StateServer for this. When you install ASP.NET it is there (just needs to be turned on) and as long as your session objects are marked as Serializable
it is great.
You can also use it in load balanced scenarios and make 1 server responsible.
I also like it for my local machine while I'm developing as it means I don't get logged out when I do a build. If you're testing a 4+ step process in a web app this is absolutely
Also have a think about how much data you are actually storing in Session. A lot of people use it for paging scenarios and overuse it for thiings that could just be posted back or use SQL server paging.
Sorry if reply is patronising at all, but question was pretty general.