Hacker News new | ask | show | jobs
by zzzeek 1774 days ago
first thought, was there a "standard" for key/value stores? mongodb the reference implementation?

overall, if you looked at HN like five years ago, every DB headline was key/value, mongodb, maybe some cassandra / couchdb, links to the "web scale" cartoon.

these days, it's SQL SQL SQL, with a heavy dose of SQLite and PostgreSQL. SQL survived the key/value fad despite the nebulousness of a workable "standard" (yes there's a SQL standard but no vendor DB implements all of it or doesn't add many many features, syntaxes, and behaviors on top of it). In particular SQLite recently seems to look to Postgresql for guidance on new syntaxes such as how it implemented upsert, it's RETURNING syntax is explicitly from PostgreSQL, and it interestingly uses the same "VACUUM" term for db utility cleanup.

2 comments

> SQL survived the key/value fad

SQL has survived every fad since the 1970s:

Stonebraker "What Goes Around Comes Around"

https://people.cs.umass.edu/~yanlei/courses/CS691LL-f06/pape...

I think sql is a bad fit for front end code in js. We may have ended up with another fight over ORMs. The Vietnam war of computer science as I think it was called.
I couldn't disagree any more, at least in my specific field, where my data is generally static and extremely relational. Writing JS to do what SQL does is... a pain. But having SQL on both the frontend and backend would dramatically simplify the translation abstractions between the two - for a similar reason that node on the backend simplifies translation abstractions. It ultimately means less code and less thinking.
How else would you suggest full applications run in the browser. Desktop apps make use of SQLite all the time even when they are mostly server backed.

An example is that Telegram maintains a local db which stores the most recently accessed content so you can scroll through past messages and media without having to request them every time you view them.

Desktop apps use SQLite because it's the embedded structured datastore that already exists, not because they want to use SQL. If it was easy to embed, IDK, some kind of file-backed redis, I'm pretty sure a lot of apps would use that instead.