Are MongoDB and CouchDB perfect substitutes?

raoulsson picture raoulsson · Jan 2, 2010 · Viewed 7.2k times · Source

I haven't got my hands dirty yet with neither CouchDB nor MongoDB but I would like to do so soon... I also have read a bit about both systems and it looks to me like they cover the same cases... Or am I missing a key distinguishing feature?

I would like to use a document based storage instead of a traditional RDBMS in my next project. I also need the datastore to

  • handle large binary objects (images and videos)
  • automatically replicate itself to physically separate nodes
  • rendering the need of an additional RDBMS superfluous

Are both equally well suited for these requirements?

Thanks!

Answer

rfunduk picture rfunduk · Jan 2, 2010

I've actually used both pretty extensively, both for very different projects.

I'd say they are equally well suited for the requirements you list, however there are quite a lot of differences between the two. IMO the biggest is their query-ability. CouchDB doesn't have 'queries' in the RDBMS sense (select * from ...) but instead uses 'views' which are more like stored procedures (essentially, static queries defined in the database (1)). MongoDB has much more 'usual' querying.

Essentially it comes down to your application requirements. If you give more information I might be able to shed some more light on what might matter in that situation.

(1): you can have temporarily, non-static queries in CouchDB but they aren't recommended for production use