3 ms·
What would Mongo give you that Postgres doesn't?
by AYBABTME 8y ago
What would Mongo give you that Postgres doesn't?
- Fre_d 8y agoAdmittedly I'm not yet using it in production, but the simplicity is the most appealing factor, albeit this depends a lot on client libraries used. In addition to my original comment, with Postgres we also had to deal with schemas and migrations. We can also easily leverage reactive streams with reactive Spring Data. Technically you could also use JDBC in a reactive manner, but it looks unlikely to work with the frameworks we use with Postgres.
- aeonflux 8y agoIf simplicity and lack of migrations is the only advantage of MongoDB then there is no reason to use it in place of Postgres, since you can just use JSONB instead and not worry about any of those.
- jacques_chester 8y ago> with Postgres we also had to deal with schemas and migrations. Schemata are good things. Migrations are the database insisting on tedious bureaucratic nonsense like "don't blow your foot off" and "don't regret this later". > Technically you could also use JDBC in a reactive manner, but it looks unlikely to work with the frameworks we use with Postgres. The Spring team are pretty keen on removing that gap: http://r2dbc.io/ http://r2dbc.io/
- luord 8y ago> with Postgres we also had to deal with schemas and migrations. JIC, this is exactly what I meant with "paying that debt upfront". If your model does turn out to be relational and you don't have this, you are going to get burnt, badly.
- snazz 8y agoNon-relational (NoSQL) databases like Mongo serve a different purpose. They store data in forms other than the traditional relational database table. Theoretically, for certain workloads, they make horizontal scaling easier and improve availability. However, most workloads are suited just fine with a relational database like Postgres.
- andrewguenther 8y agoPostgres also had document store functionality and for many workloads performs better than Mongo. In my personal experience, Postgres is better at being Mongo than Mongo.