Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

MongoDB vs. PostgreSQL for NBA Data Crunching

DZone's Guide to

MongoDB vs. PostgreSQL for NBA Data Crunching

· Java Zone
Free Resource

Learn how to troubleshoot and diagnose some of the most common performance issues in Java today. Brought to you in partnership with AppDynamics.

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.

Understand the needs and benefits around implementing the right monitoring solution for a growing containerized market. Brought to you in partnership with AppDynamics.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}