DEV Community

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

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
polterguy profile image
Thomas Hansen • Edited

I too would use a SQL database for the majority of database work as it supports what I'm trying to do for most of my specific needs

Awesome, then we agree 100% - My problem is that I see a lot of people choosing NoSQL because it's "cool" ...

There are CRUD generators for NoSQL databases too which take a few minutes also

You cannot do this, not even in theory, with a db that doesn't have a strongly typed schema. You could of course just return "whatever you've got" as documents in your db to the caller, but that would potentially risk returning stuff such as credit card information, and other sensitive data to unauthorised callers ...

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
polterguy profile image
Thomas Hansen • Edited

To other readers I was basically saying that you can use CRUD generators in NoSQL solutions so that point doesn't prove anything

As to CRUD an NoSQL; Yet again, you cannot do this, not even in theory. Generating a CRUD API by the very definition of the term, implies having access to meta data, unless you want a CRUD API that says; "Create, Read, Update and Delete 'garbage'".

Meta data in these regards translates to "a schema". NoSQL databases do not have a schema, and in fact this is a large part of their unique selling point.

To understand the dilemma, check this app, and ask yourselves; "How can I implement this CRUD app when I have no schema?"

The database schema is the formal specification that the above app was generated around. No schema, no meta data - No meta data, no specification - No specification, no app ... :/

Of course, if you've got a NoSQL database with a schema, the argument becomes different ...

However, the last time I checked, neither Cosmos, Mongo, CouchBase or Dynamo had schemas ...