bad for sessions?

Perrin Harkins perrin at elem.com
Fri Feb 11 11:45:30 PST 2005


On Fri, 2005-02-11 at 14:37 -0500, Tom Jenkins wrote:
> i was scanning the archives and i noticed a statement by someone a few
> months back that seem to be saying that using memcached hold web session
> data was a bad idea according to brad(? or someone).  but they never
> gave a reason or a link to the discussion if it was on the list.  could
> someone summarize why memcached would not be a good tool?

Because it is a cache, not a database.  It keeps the data in memory and
makes no effort at durability.  If a memcached server goes down, all the
data is simply lost.  There is failover in terms of operation, but it
does not save any of the data.

> as an aside i found out about memcached via a python blog where the guy
> was describing using it for ... web session data <wink>.

I hope the site doesn't store anything in the sessions that people would
be upset to lose.

Most sites can use MySQL for sessions with no scalability issues.  If
you are big enough to need more than that, use memcached as a
write-through cache for your session data in front of a database.

- Perrin



More information about the memcached mailing list