3 ms·
Perfect! We at Shippable moved from NoSQL MongoDB to PostgreSQL for several reasons. Here is a small story, It started with small problems... Even though we h
by pavbelshippable 8y ago
Perfect! We at Shippable moved from NoSQL MongoDB to PostgreSQL for several reasons. Here is a small story,
It started with small problems...
Even though we had the ability to add features at a lightening pace, we started seeing occasional downtimes which always seemed to come down to MongoDB. For instance:
> We were very happy to have 24x7 availability with primary and secondary instances of MongoDB. However, our perf suddenly deteriorated one day and retrieval started taking more than a second per document. We tried using many tools and profilers, but could not figure out what was happening. Finally, we rebuilt a new server, switched that over as primary, and rebuilt our secondary. Retrieval times dropped to 150ms again. This is still an unsolved mystery!
> Our Mongo instance reached 4TB and we were proud of our growing adoption. Due to the lack of tooling around managing large DBs, we relied on indexes to keep the search times low. When NoSQL DBs first became popular, there was no way to create uniqueness, so these features were built as an afterthought. Some of the bloating of our MongoDB was actually due to indexes, but rebuilding them was primitive and the entire DB would lock down.
> At one point, we needed to reboot our DB server and it took MongoDB 4 hours to come back online. This led to an extended downtime for our service, and we had very little visibility into the MongoDB process or status.
And then came the knockout punch!
The biggest advantage, and disadvantage, of MongoDB is that it has a flexible schema. This means that documents in the same collection (aka table in the old world) do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data. In a nutshell, there are no strict schema rules and this opens it up to a lot of cowboy tinkering.
While many developers love the flexibility, it also puts a very high degree of responsibility on their shoulders to get things right.
The whole experience we have written on our blog http://blog.shippable.com/why-we-moved-from-nosql-mongodb-to-postgressql http://blog.shippable.com/why-we-moved-from-nosql-mongodb-to...
- mmt 8y agoWorth mentioning the two links toward the end of your story: https://www.sisense.com/blog/postgres-vs-mongodb-for-storing-json-data/ https://www.sisense.com/blog/postgres-vs-mongodb-for-storing... https://www.enterprisedb.com/node/3441 https://www.enterprisedb.com/node/3441 (mongo-pg perf comparison)
- nojvek 8y agoAlmost everything has a schema. Whether you explicitly write it down or have it in someone’s head. If you really want schemaless then use JSON type in a relational DB. Also with huge memory and risk machines, one could go multi terabytes with a 3 machine cluster on a relational database.
- fogetti 8y ago> "And then came the knockout punch!" I am trying to understand what you say. So basically this was not clear for you from the beginning?