5 ms·
What do you mean memcached is not good for MySQL?
by aaroneous 18y ago
What do you mean memcached is not good for MySQL?
- gnaritas 18y agoHe's probably wanting to cache entire result sets instead of individual objects so he's running into problems wanting to expire lots of duplicate data when the db gets updated. Seems to be common misuse of Memcached when people first try it. Memcached is perfectly fine to use with MySql, just don't cache query results directly, cache the individual rows so there's only ever one copy of that row cached. You can then update the cache when you update the db. If you need to cache queries, cache just the keys for the result of the query and use them to go back and fetch the cached rows individually from Memcached. Use a multi get for faster retrieval. Memcached is a distributed object cache, keep each object in it only once and you won't need to expire stuff. You could also use the object version as part of the cache key which will auto expire older version by making all the clients look for the newer version. Old versions will be pushed out naturally as newer version fill up the cache.
- mariorz 18y agoMySQL has it's own query cache, if that is what he means he should just increase the query cache size really.