Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Cache in Database is really bad?

I've read in several places say the database cache is not recommended, do you share this opinion? or sometimes it is good to use the cache in the database.



61.2k

by database you mean mysql ? probably very bad :D , makes no sence to search for anythiong inb that cache ?

http://redis.io/



15.9k
Accepted
answer
edited Sep '16

Database Cache is good when there is no other cache

see: https://www.percona.com/blog/2006/08/09/cache-performance-comparison/



61.2k
edited Sep '16

yes ofc ... Peter Zaitsev | August 9, 2006 ....

and key,value for mysql is

    $key="test";
    $data="MyTestString";

which doesnt many any sence ? you probably need text field, which is not very hight speed. Also you need to delete/edit those caches also... i dont see a benchmark of that.

I really dont see how mysql can beat memcache or redis.. i mean people use memcache to speed up mysql ...



61.2k

Query Cache and cache in database are 2 complatly diffent things btw :-)

i guess i miss understood you

Yes, Database Cache != Query Cache.

Claramente se equivoco al escribir 'database cache' y puso 'query cache'.

Well mysql has builtin result query cache. If you will make any query then result of it will be saved to cache, if you will make another query it will be got from cache.

HOWEVER, ANY CHANGES to table will result in invalidate of all cache keys.