Asp.net session distributed sharing solution, asp. netsession
Session sharing is an important part of distributed system design. Compared with the session Sharing Solution in java, there are still few solutions in. net, and the MemcachedSessionProvider class library is excellent.
EnyimMemcached is the memcached client in windows. This is a good class library. The MemcachedSessionProvider we will talk about later needs to implement session sharing based on this memcached client.
Github address: EnyimMemcached
Microsoft for us to achieve session sharing, but based on SQL server database, please see Nginx + IIS Load Balancing Session multi site sharing (http://www.cjjjs.com/paper/gzsh/2017102418155818.html ), if this design scheme is adopted in the project, this design will reduce the performance because the database is frequently read. However, Microsoft also provides a base class SessionStateStoreProviderBase.
For details, see How to: Sample Session-State Store Provider. MemcachedSessionProvider is also designed based on this base class. I have to say that many of Microsoft's basic classes are well designed and well considered!
Github address: MemcachedSessionProvider
I implemented it roughly, But I didn't implement session sharing. I think it should be because I didn't understand the example on github (I think I want to talk about it, I really don't understand the test code (test file) in github ))