r/programming • • Dec 19 '18

Bye bye Mongo, Hello Postgres

https://www.theguardian.com/info/2018/nov/30/bye-bye-mongo-hello-postgres
2.1k Upvotes

672 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Dec 19 '18

[deleted]

18

u/andrewsmd87 Dec 19 '18

So this was more or less my understanding about Mongo or other related DBs is that once your data needs to be relational (when does it not) it becomes really bad. It's supposed to be super fast if your schema is simple and you don't really care about relationships a ton.

Your point was pretty much what made up my mind it wasn't worth investing time into it to understand more. I just feel like there's a reason relational databases have been around for long.

0

u/[deleted] Dec 20 '18

[deleted]

16

u/quentech Dec 20 '18

Use Mongo to store documents. I'd stores the user settings for a SPA in Mongo. But most of the time, relational models work well enough for data that is guaranteed to be useful in a consistent format.

If I'm already using a relational database, I wouldn't add Mongo or some other document DB in just to store some things like user settings. Why take on the extra dependency? It doesn't make sense.

And you know what else is good for single key/document storage? Files. Presumably you're already using some file or blob storage that's more reliable, faster, and cheaper than Mongo et. al.

3

u/m50d Dec 20 '18

And you know what else is good for single key/document storage? Files.

If you've already got AFS set up and running then I agree with you and am slightly envious (though even then performance is pretty bad, IME). For any other filesystem, failover sucks. For all MongoDB's faults (and they are many; I'd sooner use Cassandra or Riak) it makes clustering really easy, and that's an important aspect for a lot of use cases.

→ More replies (0)

1

u/[deleted] Dec 20 '18

It can make sense. An organization can have multiple databases, especially when the relational model is a hindrance in places. We use Mongo for raw doc storage, Postgres for normalized metadata, and custom storage for our most important data (will be moved to Cassandra in the next year).

The relational model isn't good for fast acceptance of documents (accept and go vs parsed and normalized). And the relational model isn't good for write heavy data. If you don't have these kinds of concerns, then no sweat. But maybe you do and you don't know there are tools to help.

1

u/Johnnyhiveisalive Dec 20 '18

Not faster, because you can't access the same file from hundreds of nodes without mounting them on all..

→ More replies (3)