Can someone tell me why is it so bad?
I've searched for concrete answers but I got none for the moment yet from time to time people say these kind of things and I worry.
Can someone tell me why is it so bad?
I've searched for concrete answers but I got none for the moment yet from time to time people say these kind of things and I worry.
Historically MongoDB has been known for dropping or mangling data in some unfortunate ways, I'm not entirely sure what the story there is these days but personally I wouldn't trust it ever again. Data integrity is too important.
Granted, the compression story in postgres isn't currently amazing.
> Querries were also somewhat faster in Mongo.
If you really want fast queries it's not super hard to tune postgres to be fast and drop data if it crashes. It's a bit trickier to tune it to be quite that fast if you want to keep all your data, but for a single table of json documents it should be doable if you're okay with not having transactions.
If you have highly un-related pieces of data, Mongo should be fine.
But the finer point is that you can store and retrieve JSON documents very efficiently with PostgreSQL too. So, as an architect, It makes sense for me to choose PgSQL, because down the line, I have features such as relational data available without having to switch-over to other databases.
If you are happy with your stack and it works for you that is all that matters.
However, you will have a lot more features available to you by using Postgres and tools like hasura to automate your api generation.
The migration from mongo to postgres isn't that bad at all, but if it ain't broke don't fix it comes to mind.
For me, the main problem with MongoDB is that it is "schemaless" - which doesn't mean that there is no schema, just that it is not explicitly stated and enforced. This leads to problems later when schema changes and you need to be extra careful not to end up with inconsistent data (good luck with that). But this is solveable, it just takes more effort than necessary.
If you are using MongoDB for a small-ish project you should be ok. And if your project becomes big, you will need people who know the difference and will be able to migrate (if needed) anyway. So no worries, and good luck with your project! :)
But for relational data, PostgreSQL or MySQL will be a better choice (and I can't see this changing).