Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
325 views
in Technique[技术] by (71.8m points)

.net - Is Memcached interchangeable with ASP.NET State Server?

I use ASP.NET and WCF services in a load balanced web server environment, using Memcached in the service layer.

I also wanted to replace the use of ASP.NET State Server (for Session State) with Memcached. Now I am afraid it is not a good thing, because from what i understand, Memcached is a cache server rather than a state server, is that true?

If I understand correctly, Memcached is not distributing data to other nodes in the Memcached farm. Instead, a special hashing algorithm is used to determine which one of the nodes in the farm contains the data of a requested key, whereas ASP.NET State Server distributes data ASAP when it has been added, to prevent a Single Point of Failure.

In other words, Memcached should be used only for performance reasons, the data stored in it should always be re-creatable, in case the item has been removed to make room for new objects, or in case the single machine actually storing the data went down.

So can I not rely on Memcached only for storing session state data? If i can't, then i don't understand how Memcached is often compared to and seen as an alternative to using ScaleOut StateServer and ASP.NET State Server, since these are really state servers, which is another thing, right?

I am now a bit unsure as to what is the best approach for high performance distributed session state in a web server farm.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

http://www.codeplex.com/memcachedproviders has a session state provider for asp.net that stores values in memcached. It provides the ability to backup the session data in ' SQL Server. As yogman said the session data is stored as one value. If an eviction happends, whole session for that user is lost and user will be directed to the login screen. Memcached doesn't evict any data before expiration unless it is running out of space to hold new data.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...