Over a million developers have joined DZone.
Platinum Partner

MongoDB vs. PostgreSQL for NBA Data Crunching

· Java Zone

The Java Zone is brought to you in partnership with AppDynamics. Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems.

There is a long-ish tradition of comparing things to MongoDB. You know, MongoDB vs. Oracle, and MongoDB vs. Cassandra, and MongoDB vs. Redis and CouchDB. Now, Dmitri Fontaine at tapoueh.org has provided a new comparison: MongoDB vs. PostgreSQL. Fontaine's comparison works with an interesting dataset comprised of 30 years worth of NBA scores, teams, wins, and so on - it's actually a response to an earlier article that used MongoDB's aggregation framework to work with the dataset - and shows how PostgreSQL would handle similar operations. 

Fontaine tries to follow the same queries as the earlier author, and finds that he sometimes produces produces slightly different results. Central to Fontaine's argument, though, is that his comparable SQL queries are more readable and more complete; in other words, he argues that it is clearer how he produced his results than it is in the MongoDB results.

Ultimately, Fontaine's argument is that MongoDB is late to the game. He says:

It's quite hard for me to appreciate the work done in the MongoDB aggregation framework really, when we've been enjoying advanced aggregation and statistics in PostgreSQL for a very long time. With the addition of Window Functions and Aggregate Functions for Statistics it's possible to implement advanced analysis right into your SQL queries.

Check out Fontaine's full article for the complete queries and his back-and-forth with the original NBA MongoDB article.

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}