Are document-oriented databases meant to replace relational databases? Are document-oriented databases meant to replace relational databases? mongodb mongodb

Are document-oriented databases meant to replace relational databases?


Are document-oriented databases have been developed to be the next generation of databases and basically replace relational databases completely?

No. Document-oriented databases (like MongoDB) are very good at the type of tasks that we typically see in modern web sites (fast look-ups of individual items or small sets of items).

But they make some big trade-offs with relational systems. Without things like ACID compliance they're not going to be able to replace certain RDBMS. And if you look at systems like MongoDB, the lack of ACID compliance is a big reason it's so fast.

Is it possible that projects would be better off using both a document-oriented database and a relational database side by side for various data which is better suited for one or the other?

Yes. In fact, I'm running a very large production web-site that uses both. The system was started in MySQL, but we've migrated part of it over to MongoDB, b/c we need a Key-Value store and MySQL just isn't very good at finding one item in a 150M records.

If document-oriented databases are not meant to replace relational databases, then does anyone have an example of a database structure which would absolutely be better off in a relational database (or vice-versa)?

Document-oriented databases are great storing data that is easily contained in "key-value" and simple, linear "parent-child" relationships. Simple examples here are things like Blogs and Wikis.

However, relational databases still have a strong leg up on things like reporting, which tends to be "set-based".

Honestly, I can see a world where most data is "handled" by Document-oriented database, but where the reporting is done in a relational database that is updated by Map-reduce jobs.


This is really a question of fitness for purpose.

If you want to be able to join some tables together and return a filtered set of results, you can only do that with a relational database. If you want mind-bending performance and have incredible volumes of data, that's when column-family or document-oriented databases come into their own.

This is a classic trade-off. Relational databases offer you a whole suite of features, which comes with a performance cost. If you couldn't join, index, scan or perform a whole other list of features, you remove the need to have any view over ALL data, which gives you the performance and distribution you need to crunch serious data.

Also, I recommend you follow the blogs of Ayende Rahien on this topic.

http://ayende.com/blog/


@Sohnee is spot on. I might add that relational databases

  • are excellent for retrieving information in unexpected combinations -- even if that occasionally leads to the Bad Idea of extensive reports being run on time-sensitive production systems rather than on a separate data warehouse.
  • are a mature technology where you can easily find staff and well tested solutions to any number of problems (including the limitations of the relational model, as well as the imperfect implementation that is SQL).

Ask yourself what you want to do, and what qualities are important to you. You can do everything programming related in shell scripts. Do you want to?