Memcached newbie questions

Herc kingherc at
Sun Dec 30 23:13:46 UTC 2007

Hello to all and a happy new year,

I've just tapped into the memcached situation. We had a web server +
mysql server with huge load averages, and we're hoping to use
memcached to save us! Though we implemented php's session to mitigate
the problem, we think memcached is a bit more advanced in caching.
I've searched the internet for memcached, but couldn't get a clear
answer on the following questions:

- Does php's memcached client API supports (consistent?) key hashing?
- Is memcache's php session handler a good way to store information
about a user? Or would it be better to manually store user info to
memcache? I'm trying to figure out if memcache's session handler saves
variables as one big chunk (so it cannot overpass the 1MB limitation)
or as different chunks (that transparently integrates them into the
php $_SESSION array).
- The most intriguing issue I've been buffled about is the following:
How to store SQL results. For example, say I store SELECTs as md5 into
memcache. Then say at some point in the code, an UPDATE is executed.
How can I determine which memcache keys (that is, which SELECTs)
should be invalidated?? Is there a framework or some way that do this
gracefully? Or should I use memcache only for queries that do not need
be updated immediately, but can update after they expire?

Thanks for any help!


More information about the memcached mailing list