This is a question about using Redis and mongoDB together.

Asked 1 years ago, Updated 1 years ago, 95 views

First of all, I am implementing web messenger with node.js and socke.io. As I looked it up, I know that Redis is a NOSQL-based DB like Mongo, but there are cases where it is mixed with Mongo, so why is this case? I think it's because Redis also saves it on disk, but it's used in cache, so it's fast to access. Is it to save it in Mongolia and use it in the cache? Or maybe there's another reason. Or I wonder if I can only use Mongolia or Redis!

redis mongodb node.js socket.io

2022-09-21 18:55

2 Answers

If you do not configure a cluster, the installed server has a memory limit. Writing to disk is to recover data on restart.

Mongolia is disk-based, so there is virtually no capacity limit.

Usually, when using the two together, the ready is often used as a cache.

In other cases, the pub-sub is supported by Redis, so it may be used as an auxiliary for rails that are difficult to maintain the connection.


2022-09-21 18:55

MongoDB is for storing data

Redis is a cache server that puts data into and out of memory.

When using both, Mongodb is the concept of storing data forever and reducing Redis server overhead, and storing it in memory to increase speed

If you don't need it, you can only use MongoDB for storage.

If you want a lot of people to come in and the speed is important, you can use Redis to cache the site


2022-09-21 18:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.