Search code examples
asp.netsession-stateappfabrichigh-availability

How can the session state still be available when the AppFabric is crashed?


I'm using AppFabric as the session state provider for ASP.NET, and I'm thinking of a solution of HA. I find when the AppFabric is crashed, the entire web application will be affected. Can I have a solution to let ASP.NET routes to use in-proc session to make more HA when the AppFabric is crashed? Thanks in advance.


Solution

  • If you have just one server then switching to inproc sessions might make sense but if you have multiple servers and you're not using sticky routing (which doesn't make sense if your sessions were distributed) then only its going to benefit you.

    Although I don't think there is any out of the box way of doing this but in principle it should be possible for you to write a session provider that switches from appfabric to inproc session and somehow signals your load balancer to resort to sticky sessions.

    However you should note that if you have multiple servers in your app fabric cache then likelihood of all of them going down at once is very low so I would not even implement any over engineered solution.