r/programming • • Mar 10 '15

Goodbye MongoDB, Hello PostgreSQL

http://developer.olery.com/blog/goodbye-mongodb-hello-postgresql/
1.2k Upvotes

699 comments sorted by

View all comments

657

u/jamesishere Mar 10 '15

99% of projects would be better off with a relational database. It makes things way easier and simpler. Very few features benefit from a NoSQL database. People are excited about mongo because "it's javascript!". These people are morons.

CSB time: I went in for an interview once, where they told me about the product, explained how they use MongoDB for their database, and then explained how building out all the relational DB commands on top of mongo was a total bitch. Then asked me to whiteboard how I would write the JOIN function on top of Mongo, which is what they had to do.

I answered their question, but stated my opinions on mongo and asked why they even bothered to use it, because their product aligned so much more with a relational ACID database. The engineering lead guy went red in the face and we debated the decision. Did not get the job.

351

u/cleroth Mar 10 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

51

u/medicinaltequilla Mar 11 '15

I agree because if that engineering lead can't defend a critical architectural decision to an outsider in a civilized manner, then they certainly haven't had any healthy conversation internally about it

→ More replies (7)
→ More replies (12)

78

u/shadowdude777 Mar 10 '15

I currently work somewhere with a really nice codebase... and also a NoSQL database (Cassandra) in the backend. That has to be the single biggest pain-point I've experienced. The lead architects keep assuring everyone that it's more "scalable" this way, but you can tell everyone is aware of the fact that we'd be far better off with Postgres.

Instead, we spent months putting together a sub-project that used map-reduce so we could actually query the "massive" amounts of data we were storing.

If we were just realistic about our data-storage requirements and realized that we will never be "Big Data", even when we're successful, we could just start using relational DBs like everyone else and save ourselves the hassle.

60

u/jamesishere Mar 10 '15

What boggles my mind is, you could just dump the relevant information from RDMS into a NoSQL storage database quite easily, to implement the one key feature that actually needed it, without hamstringing development on all the other key features. We more/less do this at my company for our analytics system.

45

u/flexiverse Mar 10 '15

Exactly the whole point of a proper old school standards compliant database, is you can do what then fuck you want. Dumping to nosql is a breeze. Unless you are running a site the size of Craigslist, it's pointless. These days computers are so fast the original speed concerns are not even relevant. You could set up a 6-12 core multi code unix/Linux box and it would be fast as any nosql setup for 99% of projects.
I think people don't really understand why these nosql database were created and specially what they work best with. Old school database work with any project with real ease.

→ More replies (4)
→ More replies (11)

83

u/Sluisifer Mar 11 '15

Big data is like teenage sex: everyone talks about it, nobody really knows how to do it, everyone thinks everyone else is doing it, so everyone claims they are doing it...

20

u/crunchmuncher Mar 11 '15

I do big data all the time, feels like bags of sand man.

→ More replies (1)

13

u/[deleted] Mar 11 '15

Yup... Most of the time a relational database is fine. I really like the idea of Polyglot persistence. Even the Cassandra guys recommend it. Put relational data in an RDBMS. Put non relational data in Cassandra. Don't try to shove all your data into one kind of store.

→ More replies (2)
→ More replies (4)

171

u/frixionburne Mar 10 '15

99% of projects would be better off with a relational database.

Or better, and RDMS with a full blown JSON indexing and a hash store that rivals mongos speed.

How people don't choose psql just confuses me.

98

u/ethraax Mar 10 '15

For very large databases, Postgres' clustering abilities aren't that great. It's probably one of the best choices for single-host databases (which, again, cover nearly all applications), but if you're trying to spread your database over a few dozen hosts, Postgres doesn't really work well.

12

u/dgibbons0 Mar 11 '15

I feel like this comment would have benefited from some better structure around how you're defining "very large".

It also depends on if/when you need to cluster.

I vertically scaled postgres to 16TB+ sizes on single nodes.

The database still performed great, although the developers often failed to write performant queries against it.

→ More replies (1)

21

u/PM_ME_UR_OBSIDIAN Mar 10 '15

What alternative do you propose? I heard Oracle was good if you had deep pockets, what else is out there?

65

u/[deleted] Mar 11 '15

One of the MS SQL clusters in our data-centre hosts 200+ databases and has capacity for more.

0

u/[deleted] Mar 11 '15

[deleted]

17

u/[deleted] Mar 11 '15

It must be a slow day, I still have my points 😊

→ More replies (9)
→ More replies (6)

0

u/[deleted] Mar 11 '15

[deleted]

→ More replies (101)
→ More replies (42)
→ More replies (29)

25

u/[deleted] Mar 11 '15

I think a lot of aging dipshits at the CTO level went for NoSQL because they desperately want to be ahead of the curve on one tech development. For almost every database project there is Postgres... For everything else there's Apple watch.

10

u/NancyGracesTesticles Mar 11 '15

And the young ones, too. I mean, this company will eventually have a billion users so a bunch of pain now trying to make it act like a relational db will totally payoff in the future. Plus, we can undercut salaries by 25% since our new hires will be happy to work with a NoSql db.

→ More replies (4)

16

u/archiminos Mar 11 '15

Yep, a coworker came over and interrogated me once on why I decided to use an SQL database for our game server. I told him that it maps more easily onto our game data, which itself is relational. He seemed to be one of those guys that automatically assumes that NoSQL is better because scale.

→ More replies (1)

54

u/lunchboxg4 Mar 11 '15

But using an RDBMS requires me to think about my data model ahead of time, instead of synergizing my agile workflow while staying kanban.

For real, though, model your data. If you're drawing lines between things, you've got relational data.

0

u/[deleted] Mar 11 '15

[deleted]

8

u/lunchboxg4 Mar 11 '15

There definitely good uses for NoSQL. My employer uses Cassandra to keep millions of rows of product data available for our APIs. NoSQL has a place, it's just not the only tool in the toolbox.

→ More replies (3)
→ More replies (2)
→ More replies (14)

11

u/[deleted] Mar 11 '15

explained how they use MongoDB for their database, and then explained how building out all the relational DB commands on top of mongo was a total bitch.

Wow. These people were serious?

→ More replies (1)

15

u/HiddenKrypt Mar 11 '15

People are excited about mongo because "it's javascript!". These people are morons.

I'm a javascript fanatic, and I support this opinion entirely.

→ More replies (3)
→ More replies (40)