When to use MongoDB or another document oriented database system?

By | June 27

We are building a platform for comparing websites on a detailed level. We are using MongoDB to store all the information and it works quite nicely. We use it to store all meta-information of the domains, because MongoDB better fits the requirements. For example: We retrieve different kind of data for every domain so I think that MongoDB is perfect to store this unstructured data and keep it searchable.

Now one of the next steps will be to provide a forum for our users. The question that now arises is: Use a MySQL db to store all the forum related data. or should we use mongodb for this as well. So the question is: when to use MongoDB and when to use a traditional RDBMS.

After a lot of investigating I found this article here

In NoSQL: If Only It Was That Easy, the author writes the following about MongoDB:

…MongoDB is not a key/value store, it’s quite a bit more. It’s definitely not a RDBMS either. I haven’t used MongoDB in production, but I have used it a little building a test app and it is a very cool piece of kit. It seems to be very performant and either has, or will have soon, fault tolerance and auto-sharding (aka it will scale). I think Mongo might be the closest thing to a RDBMS replacement that I’ve seen so far. It won’t work for all data sets and access patterns, but it’s built for your typical CRUD stuff. Storing what is essentially a huge hash, and being able to select on any of those keys, is what most people use a relational database for. If your DB is 3NF and you don’t do any joins (you’re just selecting a bunch of tables and putting all the objects together, AKA what most people do in a web app), MongoDB would probably kick ass for you…

And finally he concludes with:

…The real thing to point out is that if you are being held back from making something super awesome because you can’t choose a database, you are doing it wrong. If you know mysql, just use it. Optimize when you actually need to. Use it like a k/v store, use it like a rdbms, but for god sake, build your killer app! None of this will matter to most apps. Facebook still uses MySQL, a lot. Wikipedia uses MySQL, a lot. FriendFeed uses MySQL, a lot. NoSQL is a great tool, but it’s certainly not going to be your competitive edge, it’s not going to make your app hot, and most of all, your users won’t give a shit about any of this.
What am I going to build my next app on? Probably Postgres. Will I use NoSQL? Maybe. I might also use Hadoop and Hive. I might keep everything in flat files. Maybe I’ll start hacking on Maglev. I’ll use whatever is best for the job. *If I need reporting, I won’t be using any NoSQL.* If I need caching, I’ll probably use Tokyo Tyrant. If I need ACIDity, I won’t use NoSQL. If I need a ton of counters, I’ll use Redis. If I need transactions, I’ll use Postgres. *If I have a ton of a single type of documents, I’ll probably use Mongo.* If I need to write 1 billion objects a day, I’d probably use Voldemort. If I need full text search, I’d probably use Solr. If I need full text search of volatile data, I’d probably use Sphinx.
I like this article, I find it very informative, it gives a good overview of the NoSQL landscape and hype. But, and that’s the most important part, it really helps to ask yourself the right questions when it comes to choose between RDBMS and NoSQL. Worth the read IMHO…

Hope that helps a little bit