Hacker News new | ask | show | jobs
by infecto 3777 days ago
Glad I am not the only one. I do not understand why most JS frameworks use a NoSQL store. Even from their FAQ.

"You can always replace Mongo with another DB like RethinkDB, CouchDB or something else you like. :)" What about SQL??!?!

2 comments

Most of the "nodejs generation" would take simple queries + aggregates (https://docs.mongodb.org/manual/aggregation/) + some flavor of map-reduce (https://docs.mongodb.org/manual/core/map-reduce/) over SQL anytime. Mostly because you only need the first for 90% of the cases, and for the rest, SQL is "brain hurting" and hard to optimize anyway. I also happen to agree that SQL should be finally killed and buried (and invent a more "in code" and closer to mathematical language notation for when you really need to do relational algebra, something like a "relational GraphQL maybe"), though most of the colleagues of my age would prefer to bury me for expressing this opinion :)
Working at an organization that does both, the thing that jumps out to me is that SQL is a bit painful from the "application developer" side, but fantastic from the "ad-hoc data analysis" side.

It's tough for me to say "finally killed and buried" when I have a couple dozen colleagues being wonderfully productive with SQL as one of their primary tools. Application developers and analysts don't need to use the same tool, though.

2 theories:

(1) Node sprung up at the exact same time that NoSQL was in it's "fad" phase (which had much to do with fighting the now-mostly-solved scaling challenges of the SQL databases of the time). Both caught on with people who liked trying the hot new thing in 2010.

(2) There's definitely a bit more impedance mismatch when you're working with a SQL database from JS. If what you're trying to do is persist a blob of JSON, a NoSQL object/document store works at that level, whereas a SQL database requires thought and planning.

This is not to say that I prefer NoSQL, or that these are reasons why someone starting something now should choose NoSQL, but they do jump out to me as why backend JS dev has been a bit more NoSQL-happy over the years.