search

Home  >  Q&A  >  body text

If mongodb is used as a persistent storage database, is it necessary to use redis for another layer of cache?

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?

滿天的星座滿天的星座2778 days ago1142

reply all(3)I'll reply

  • 阿神

    阿神2017-05-16 13:21:03

    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.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 13:21:03

    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.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:21:03

    Could it be that mongodb has implemented a cache of hot data in memory?

    Correct.

    Mongodb is used as a persistent storage database. Is it necessary to use redis for another layer of cache?

    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.

    reply
    0
  • Cancelreply