Storing sessions in memcache(d)

Sometimes I hear idea about storing user session data in memcache. It is great idea, memcache is fast, easy to scale, cached data can be shared between many servers, so it is not necessary to takeĀ careĀ about advanced load balancing. Yeach it is a trap. Even official Memcached FAQ says that:

http://code.google.com/p/memcached/wiki/NewProgrammingFAQ#Why_is_memcached_not_recommended_for_sessions?_Everyone_does_it!
http://dormando.livejournal.com/495593.html

To prove that described situation can easily happened I wrote some example code available here https://mrok@github.com/mrok/memcache_test.git. Download it, fix memcache configuration section, run and wait for first missing key. Do you still think it is good idea?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">