See morw...

Tuesday, February 8, 2011

Mongo vs Couch Vs Redis


Advantages:

Mongo

  • Lightening fast. 
  • Auto sharding on it's way (August)
  • Replication is very easy.
  • You can perform rich queries, can create on the fly indexes with a single command.

Couch

  • Very persistent, no power failure, system crash will do anything to your data.
  • Everything is HTTP. You can serve a CouchApp from database itself using views.
  • Replication is easy, and can be uni or bi-directional.
  • Conflict resolution is a breeze. For distributed systems, this is a must have.
  • Uses Erlang, you can run CouchDB even on your tiny phone!
  • Guys at Meebo created Couch-Lounge, a sharding tool.
  • Everything on disk. Very durable.

Redis

  • Lightening fast.
  • Replication possible.
  • Cool datastructures available within realm of key-value.

Disadvantages:

Mongo

  • Very unreliable. No single server durability. If something crashes while it's updating 'table-contents' - you loose all you data. Repair takes a lot of time, but usually ends up in 50-90% data loss if you aren't lucky. So only way to be fully secure is to have 2 replicas in different datacentres.
  • Indexes take up a lot of RAM. They are B-tree indexes and if you have many, you can run out of system resources really fast.

Couch

  • Couch maintains a different document for every update you make. This is done to save all revisions of a document. Although this is a positive feature, this fills up your hard disk fast. You can run asynchronous compaction to delete all old revisions, but this generally takes hours and is system intensive. But this is a trade-off for redundancy.

Redis

  • Memory only.
  • You can have slaves, but it's not distributed yet. Although they intend to add it in future.

2 comments:

Anonymous said...

Thanks for posting this, gives me a good starting point for trying some of these. And hello from Chiang Mai :)

Sampath Munasinghe said...

install ruby on rails with mongodb.

I had some experience and started new project.