Ask HN: Mongodb vs Redis for Django?

6 points by fjabre ↗ HN
Hi,

We're slowly realizing that the benefits of using a non-relational db for our upcoming web app are too big to ignore in terms of scalability. We're running a typical Django/Postgres setup but are looking at alternatives. We're discovering that Postgres is becoming quite the bottleneck in terms of users/server that we can handle.

My question is this: Are there any particular nosql solutions recommended for a Django app like Mongo or Redis? Also, are there any good cloud based services that are setup to do just this other than Amazon's Simple DB?

Thanks

3 comments

[ 2.6 ms ] story [ 18.0 ms ] thread
While I don't have enough Django experience to give suggestions on that front, you can use BigTable if you want to move to Google App Engine, though the drawbacks may outweigh the benefits when dealing with an established app.

That said, I did recently make this choice for a Ruby/Sinatra app I'm working on, and ended up going with MongoDB due to conveniences like MongoMapper more than anything else (I wanted to enforce a partial schema without having to resort to silliness like customField1, customField2, etc.) I'm pleased with this choice so far, though plan to look at Redis again in the future when I need something lighter in weight for storage.

From a Ruby perspective, but this may still be useful: Redis is very nice for data that fits in memory (disk persistence is for recovery, not for realtime access) and support for counters, sets, etc. is cool.

That said, I really like MongoDB for many reasons: interactive shell, great Ruby support (and Scala and Clojure, etc.), very easy to set up and use, and some replication support (not as good as Cassandra, but I will never need that kind of scalability).

I think that the Python support for MongoDB is very good.

I'd say it really depends on what you're storing and how you're using it.

Redis is great for situations where you need a very large volume of reads and writes, and have a fairly simple data model. See http://simonwillison.net/static/2010/redis-tutorial/ for more information and some use cases.

MongoDB allows for data to be structured and queried in more complex ways, and touts itself as more of an alternative to an RDBMS than Redis does. If you're looking to use it with Django, check out MongoEngine at http://github.com/hmarr/mongoengine