Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB v/s Redis [closed]

Tags:

mongodb

redis

Primary requirements:

  1. Clustering and replication support and hence easy and low cost deployment in cloud.
  2. Direct support for objects. Take out ORM from the equation.
  3. Python client.
  4. Read heavy and moderate writes.
  5. Need moderate speed but nothing like stock trading.
like image 907
Pradeep Banavara Avatar asked Oct 06 '22 09:10

Pradeep Banavara


1 Answers

Based on this article

http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

I finally drilled down my database choices to Redis and MongoDB as they seem to satisfy most of the requirements. I'll explain how I'm choosing the most appropriate one for my requirements.

  1. Clustering and replication support - Redis has little no support for clustering or replication. Hence your memory grows in proportion to your data. Since we are using a cloud based infrastructure - the costs could be substantial in supporting that kind of a memory. MongoDB on the other hand supports replication and clustering. Redis 0 MongoDB 1.
  2. Direct support for objects - No ORM : Here clearly Redis is a winner as it supports a memcached like model. However, MongoDB also offers an 'object like storage' and direct support for JSON. So if I could sacrifice the speed requirements MongoDB does satisfy this need. Redis 1 MongoDB 1.
  3. Python client - both the databases have robust python clients. Redis 1 MongoDb 1.
  4. Read heavy and moderate writes - I don't think there is a distinctive difference in read performance against both these dbs. However only experience will say. For the time being - I'm giving equal scoring for both. Redis 1 MongoDB 1.
  5. Don't need stock trading like speed - Clearly MongoDB has an edge here. Redis 0 MongoDB 1.

Total score : Redis 3 MongoDB 5.

For now I'm gonna go with MongoDB. As an added bonus MongoDB also has geospatial query support. So if for whatever reason I have to add location based querying to my app, it shouldn't be really hard to make that transition with MongoDB. Let's see how things map out. I hope to come back some day and revisit this answer :). Please feel free to add anything that I've missed.

like image 131
2 revs, 2 users 90% Avatar answered Oct 10 '22 02:10

2 revs, 2 users 90%