Memcache vs Mysql's Query cache
by Rekha[ Edit ] 2010-04-24 12:32:38
Memcache vs Mysql's Query cache
* MySQL's query cache flushes as soon as you modify a table. You can store a memcached item for a minimum amount of time, but if you get a lot of write traffic, MySQL's query cache will be constantly expiring all entries
* MySQL's query cache has scalability issues for many CPUs. It adds a global lock, and gets slower as it has to flush more queries.
* You can't store arbitrary data objects into the cache. You can build much more efficient caches with memcached. Run several separate queries to build a user object, build the user object, then cache that. MySQL's query cache can help small sites, but can do more harm than good at scale.
* Memory is limited to how much spare RAM you have on your database. It's much nicer to give your database more RAM to cache data. With memcached you spread out the cluster wherever you have spare memory, so you can cache much much more.