|
|
| | Ask HN: Have you ever chosen Postgres over Mongo and regretted it? | |
233 points by chatmasta on July 10, 2018 | hide | past | favorite | 149 comments |
|
| The past 2 years seem to have been the death knell for Mongo and the "NoSQL" hype, with Mongo moving toward SQL parity and SQL databases supporting JSON storage, like Postgres with JSONB. At this point it seems that there are very few workloads for which Mongo is the best option compared to Postgres+JSONB. I'm wondering... 1) Have you ever chosen Postgres over Mongo, and regretted it? Why? Did you end up switching to Mongo? Was it better? 2) Can anyone name a use case where Mongo is clearly a better choice than Postgres+JSONB? |
|

Applications are open for YC Summer 2021
Guidelines
| FAQ
| Lists
| API
| Security
| Legal
| Apply to YC
| Contact
|
Later we did run into several issues caused by MongoDB which could have been avoided by using SQL (mostly related to consistency, constraint enforcement, and problems with MongoDB's aggregation capabilities). MongoDB got us to market faster, but had higher costs in the long-term.
I think there are two lessons that I'd take away: 1) There are costs to choosing a less popular technology combination, even if the individual technologies might be better (for your particular needs) in isolation. 2) Sometimes it's better to choose the more costly technology in the long-run to avoid costs early (i.e. incurring some technical debt can be the right choice). MongoDB vs SQL for us was an example of both of these.
Note: I assume SQL libraries in Node have matured significantly since 2013, so I wouldn't necessarily recommend MongoDB over SQL for new projects starting today.