Why I don't like Mongo DB
Jan 18, 2024
Gerald, why so much hate for Mongo DB? You don’t understand SCALE!
Yes, I like boring relational databases. I love SQL, SQLite. Except it’s Oracle owned.
Before anything else, once Mongo DB comes up — the first thing that comes to my mind is data integrity as it should be. Mongo DB as we all know is a NoSQL database that has gained popularity over the years. Ah, partly because it’s being used in maybe — every single Node JS beginner tutorial on the internet? Maybe that, or because in standard industries such as banking/finance, education, we tend to lean towards structured data which Mongo DB is a train-wreck for such use cases.
Mongo DB unlike the traditional SQL (relational databases) defaults in ACID (Atomicity, Consistency, Isolation, Durability) that guarantees transactional consistency and data integrity. Mongo DB assumes it’s worth sacrificing data integrity and consistency for your application in favor of performance and scalability.
Also I find the memory usage in Mongo DB pretty disgusting and not encouraging. I’m sorry to say. MongoDB’s memory and storage usage/overhead is extremely noticeable, particularly in environments dealing large datasets and high write throughput. Hence you’d find Mongo DB in your environment kind of slowing down your other applications.
So just use SQL, for petesake. Here’s a benchmark.
So as the datasets grow more than the available memory capacity, Mongo DB begins to dwindle, unfortunately.
Another clear in the night sky issue with Mongo DB, is Mongo DB’s Eventual Consistency Model. MongoDB implements an eventual consistency model, in which data updates are propagated asynchronously across distributed nodes. Though eventual consistency enhances system scalability and availability, it introduces challenges and complexity in ensuring immediate data consistency. In scenarios where immediate consistency is paramount, MongoDB’s eventual consistency would fall short, aggravating data integrity concerns.
I found this article here on geeks for geeks good enough to understand the model.
Limited join support is also another terrible, terrible problem. Mongo DB doesn’t support joins like in regular SQL relational databases. In the need to perform certain complex joins across several collections, I can fully guarantee that the experience is awful. In summary I genuinely feel Mongo DB throws out data consistency, integrity, memory management functions in the name of “scalability.” I find that absolutely catastrophic.
Lastly writing queries in Mongo DB is pretty much complex, compared to traditional relational databases. I mean, just look at that!
mongodb was a mistake pic.twitter.com/b8io5asFaE
— pilcrow (@pilcrowonpaper) January 25, 2024
Funny enough, I’d only ever use Mongo DB for “pet projects” I may never roll out. I said pet because in my opinion it’s beneath hobby projects, which I would definitely use SQLite for — or a simple store solution. I started coughing blood seeing this comment on Reddit.
I think most people going crazy over Mongo DB is due to the ease of setup and being very useful for prototyping projects. People love low-bar solutions that they can dip their feet into. The shallow end of the pool to be precise, before they move up and possibly drown. I mean look at Python. Toodles.