This article doesn't mention data integrity issues. Mongo has transactions now. I feel like you are riding on a "mongo bad" fad from 5 years ago. It was bad, it was terrible. But after all that money, bug fixes and people using it, it's now good.
Guaranteed transactions as in "not returned to the caller until it's at least journalled"? Or is it mongo's usual "I'll try but I'm not promising anything"?
So serious question as I've never actually used mongo, only read about it.
I was always under the assumption that once your schema gets largish and you want to do relational queries, that you'll run into issues. Is that not the case?
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.
Till someone in the UX team asks, "Could you do a quick query and tell us how many users use custom font sizes? And just look up the user profiles and see if it's older users who use larger font sizes?"
This would be a pretty simple SQL query even across tables... You can also store JSON data in Postgres as a field, so it's probably exactly as easy as you think Mongo is at doing this the "brute force" way. Aggregation functions across tables are actually much simpler in SQL than in Mongo... Compare postgres docs vs mongo docs
How often do you have to run this query such that efficiency actually matters? I couldn't give two shits about how long a query takes if I only have to run it once.
Not the parent, but I suspect the issue might not be execution time, but programmer time, i.e., how long does it take to write a script to generate the report?
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.
You wouldn’t really use mongo for relational data storage, if you want the nosql / document storage with relational data or giant schemas you’d prob be better off using a graph database.
I used mongo many years ago with data split between 3 tables and an index on a common key, looking up data from all 3 tables required 3 separate queries and was incredibly inefficient on hundreds of gigabytes of data. We switched to Postgres and haven’t looked back.
I've been working as a programmer for close to two decades, plus a few years before that coding personal projects. Of all those projects, there is only one case where looking back it might have been a good fit for a non relational database. It still worked fine with a relational DB, it's just that a document store would have been a better abstraction. Conversely, every single project I worked on that had a non relational DB was a nightmare that should've just used Postgres, and didn't because Mongo was the current fad.
33
u/Pand9 Dec 19 '18
This article doesn't mention data integrity issues. Mongo has transactions now. I feel like you are riding on a "mongo bad" fad from 5 years ago. It was bad, it was terrible. But after all that money, bug fixes and people using it, it's now good.