Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

What I want is not a comparison between Redis and MongoDB. I know they are different; the performance and the API are totally different.

Redis is very fast, but the API is very 'atomic'. MongoDB will eat more resources, but the API is very very easy to use, and I am very happy with it.

They're both awesome, and I want to use Redis in deployment as much as I can, but it is hard to code. I want to use MongoDB in development as much as I can, but it needs an expensive machine.

So what do you think about the use of both of them? When to pick Redis? When to pick MongoDB?

1 Answer

0 votes
by (106k points)

Redis is an in-memory data store, that can persist it’s stated to disk (to enable recovery after restart). However, being an in-memory data store means the size of the data store (on a single node) cannot exceed the total memory space on the system (physical RAM + swap space). In reality, it will be much less than this, as Redis is sharing that space with many other processes on the system, and if it exhausts the system memory space it will likely be killed off by the operating system.

Mongo is a disk-based data store, that is most efficient when it's working set fits within physical RAM (like all software). Being a disk-based data means there are no intrinsic limits on the size of a Mongo database, however configuration options, available disk space, and other concerns may mean that databases sizes over a certain limit may become impractical or inefficient.

Both Redis and Mongo can be clustered for high availability, backup and to increase the overall size of the datastore.

Related questions

0 votes
1 answer
asked Sep 4, 2019 in SQL by Sammy (47.6k points)
0 votes
1 answer
asked Oct 18, 2019 in Web Technology by Sammy (47.6k points)
+1 vote
1 answer
0 votes
2 answers
asked Sep 4, 2019 in SQL by Sammy (47.6k points)
0 votes
1 answer
asked Oct 5, 2019 in SQL by Tech4ever (20.3k points)

Browse Categories

...