DEV Community

loading...

Discussion on: Database Choices. NoSQL vs SQL

Collapse
garretharp profile image
Garret Author • Edited

From reading that it just seems there are 2 reasons you did not like MongoDB. One because you could not figure out how to model the data in a way to query at good speeds. Two because you could not add new fields easily.

I will admit point one is a bit hard because trying to model data in NoSQL is not as easy in SQL. SQL is all based on trying to normalize data and put data into as many tables as possible whereas NoSQL you denormalize all your data into one table.

For point 2 it's just as simple as running a script to add a field with a default to every document where necessary so maybe a small inconvenience it is not built-in, but creating a small script to do this is super easy to do so I do not see much of a problem here.

I personally have no used MongoDB much so I am not sure exactly how to model data in MongoDB as it does vary for each NoSQL variant (which again is annoying and can make it hard). However, using NoSQL is extremely performant (at scale NoSQL is more performant smaller apps may be the other way around) compared to SQL because of the fact you build NoSQL for queries and not for the data that is in them.

Of course, there still is some cases like analytics that are better for SQL where you may have an extreme variety of access patterns that makes it really hard to build in specific queries for the data as with analytics there are so many access patterns that are possible in that it can be impossible to know every single pattern.

Collapse
rhymes profile image
rhymes

I think you agree with me, it depends on the use case ;-)

ps. I'm not the author of the article :D

Thread Thread
garretharp profile image
Garret Author

Ah whoops thought you wrote that article haha did not pay attention to that part fully obviously. Yeah, it for sure depends on use case.

Forem Open with the Forem app