DEV Community

Discussion on: SQL is (almost) always superior to NoSQL

Collapse
 
pyrsmk profile image
Aurélien Delogu • Edited

Disclaimer: my point of view will only concern MongoDB. I'm not aware of all of the specificities of other solutions.

I worked exclusively with MongoDB for the last two years and it's a real pain. As you said 99.99% of the time you don't need MongoDB unless you need a big performance boost for specific microservices.

SQL has been proved to be well designed for several decades with a ton of good features and it will always surpass NoSQL in terms of flexibility.

Yes, MongoDB is simple and fast, but it is fast not because it is "well written" but because it's not baked with ton of features like schema validation, transactions, foreign keys, etc.. (but it seems that last versions of MongoDB begin to integrate those concepts.. which is really weird to me). Since those features aren't in MongoDB you NEED to write a whole bunch of defensive code and you need to write it WELL. The task is not easy.

Moreover, as pointed out in this post, there are plenty of queries you can't do in one call. Even with aggregation. And often you'll need to write JS to sort, filter or transform your data in the way you need it.

Unless you don't need schemas and data coherence (like stocking logs or really simple data), my best advice is : don't use it.

Collapse
 
polterguy profile image
Thomas Hansen

I only have one comment for you; Faith in humanity restored 😉

I worked with CosmosDB for 6 months. If one of my team members as much as mumbled “let’s use Cosmos” today, I’d throw the person out the window!