Mongodb is used as a persistent storage database. Is it necessary to use redis for another layer of cache?
ps: I have observed that the mongodb server process takes up more than 1g of memory when running even if the data volume is very small (more than 1g capacity). Could it be that mongodb itself has implemented a set of methods to store hot data in memory? cache?
Redis does caching just to speed up application or website access and reduce database pressure. This is the purpose of caching.
If the access speed of mongodb is normal and the pressure is not great, then there is no need to use cache.
You guessed it right, mongoDB tends to store data in memory as much as possible; redis is not needed if the pressure is not high.
Correct.
If you don’t feel it’s necessary, it’s not necessary. For MongoDB, generally only content that requires a lot of calculations needs to be placed in the cache.
In addition, Redis can not only be used as a cache, but also has many other uses.