Pros and Cons of using ASP.NET Session State Server (instead of InProc)?

前端 未结 6 2049
温柔的废话
温柔的废话 2020-12-15 17:38

Before I start using Session State server for the benefit of making session state more robust in my apps compared to InProc state, I\'d like to find a list of Pros and Cons

6条回答
  •  轮回少年
    2020-12-15 18:22

    State Server is a great(!) choice to get started with. Why? Because it means that your application is now compatible with any out-of-process storage modes.

    If you currently develop your site with InProc and wanted to move into StateServer or SqlServer at a later time, you can have issues with serialization. Not always, but it is does happen.

    Some examples include (some already mentioned):

    • Ops start scheduling regular IIS application pool recycles without your knowledge
    • Memory is running low on a regular basis
    • You will be working with a load balancer on production and cannot guarantee the same website will receive the same request.

    Therefore, its best to get this sorted out sooner rather than later. Its only a config change and a service start; Boom!

    What is also means, is if you decide to go down a completely different route of session storage, such as using Redis (Distributed Key/Value Store) or RavenDB (Document Database), you are already sorted.

    Its really is a good investment of 1 minute's work. You are now ready for web farms, load balancers and any other session management systems that you decide to prototype against.

提交回复
热议问题