Database is at the heart of any technology stack. It is no wonder we spend a lot of time choosing the right database before we dive deep into product building.
When we were faced with the question of what database to choose, we set the following criteria: The database must (1) Have a very high transaction throughput. We wanted to err on the side of "reads" but not on the "writes". (2) be flexible. I.e. be adaptive enough to take - in data variations. Since we are an early-stage start-up, not everything is set in stone. (3) Fast & easy to work with (4) Cloud Native. We did not want to spend our time in "ANY" infrastructure management.
Based on the above, we picked PostgreSQL and MongoDB for evaluation. We tried a few iterations on hardening the data model with PostgreSQL, but realised that we can move much faster by loosely defining the schema (with just a few fundamental principles intact).
Thus we switched to MongoDB. Before diving in, we validated a few core principles such as: (1) Transaction guarantee. Until 3.6, MongoDB supports Transaction guarantee at Document level. From 4.0 onwards, you can achieve transaction guarantee across multiple documents.
(2) Primary Keys & Indexing: Like any RDBMS, MongoDB supports unique keys & indexes to ensure data integrity & search ability
(3) Ability to join data across data sets: MongoDB offers a super-rich aggregate framework that enables one to filter and group data
(4) Concurrency handling: MongoDB offers specific operations (such as findOneAndUpdate), which when coupled with Optimistic Locking, can be used to achieve concurrency.
Above all, MongoDB offers a complete no-frills Cloud Database as a service - MongoDB Atlas. This kind of sealed the deal for us.
Looking back, choosing MongoDB with MongoDB Atlas was one of the best decisions we took and it is serving us well. My only gripe is that there must be a way to scale-up or scale-down the Atlas configuration at different parts of the day with minimal downtime.
mongodb is a BIG mistake. RUNAWAY when you have time!
Thanks for your feedback. Could you please elaborate a little more on what issues you faced? It would be great if you can drop your valuable feedback at firstname.lastname@example.org Thanks!
I think that mongodb is not a "Big" mistake, but it depends of the application.
Mongodb is very flexible in certain operations and has most of the functionality of other databases, I think is the perfect choice for start ups or projects that need a very fast development. If mongodb were a big mistake, mongodb would not be used by 12.k stacks.