MongoDB and PostgreSQL thoughts MongoDB and PostgreSQL thoughts mongodb mongodb

MongoDB and PostgreSQL thoughts


You dumped a decades-tested, fully featured RDBMS for a young, beta-quality, feature-thin document store with little community support. Unless you're already running tens of thousands of dollars a month in servers and think MongoDB was a better fit for the nature of your data, you probably wasted a lot of time for negative benefit. MongoDB is fun to toy with, and I've built a few apps using it myself for that reason, but it's almost never a better choice than Postgres/MySQL/SQL Server/etc. for production applications.


Let's quote what you wrote and see what it tells us:

"I like a few things with Mongodb. However, I found certain queries I was doing in PostgreSql, I couldn't do efficiently in Mongodb. Especially, when I had to join several tables to calculate some logic.""I found the ODM to be very limiting compared to what Active Record offered with traditional (SQL) database systems.""I feel more comfortable working with PostgreSql than Mongodb. Only because I can join tables and do anything with the data."

Based on what you've said it looks to me like you should stick with PostgreSQL. Keep an eye on MongoDB and use it if and when it's appropriate. But given what you've said it sounds like PG is a better fit for you at present.

Share and enjoy.


I haven't used MongoDB yet, and may never get round to it as I haven't found anything I can't do with Postgres, but just to quote the PostgreSQL 9.2 release notes:

With PostgreSQL 9.2, query results can be returned as JSON data types. Combined with the new PL/V8 Javascript and PL/Coffee database programming extensions, and the optional HStore key-value store, users can now utilize PostgreSQL like a "NoSQL" document database, while retaining PostgreSQL's reliability, flexibility and performance.

So looks like in new versions of Postgres you can have the best of both worlds. I haven't used this yet either but as a bit of a fan of PostgreSQL (excellent docs / mailing lists) I wouldn't hesitate using it for almost anything RDBMS related.