68 points · by bzbarsky · 7y ago · 26 comments
It's absolute bullshit and it's the type of bad decision that they have a history of making which causes me to not be a fan of Mozilla.
[1] https://nolanlawson.com/2014/04/26/web-sql-database-in-memor...
Oh my, that meme was in 2010, almost a decade ago...
https://github.com/localForage/localForage
I believe its maintained by Mozilla still.
There's also idb-keyval
https://developers.google.com/web/updates/2019/03/kv-storage
I'm not totally agreed with the idea of inbuilt modules, but the API is very pleasant.
I work on a fairly large project that relied on localforage for a long time. However, we have since moved to our own library to resolve a number of small issues we had with localforage.
The only issues I had with it are the lack of documentation and the fact IE, Edge and Firefox didn't support it. Perhaps it's not surprising that the MDN documentation was lacking, but I made do. Browser support on mobile was actually really good, so that didn't cause any issues.
Nowadays I'm relatively familiar with indexeddb, but I'm convinced the same project would be harder to implement with it.
Browsers should only provide low level well defined unambiguous APIs with good forward compatibility. WebSQL is not that kind of API.
And higher level APIs like SQL can be done by user libraries.
Same way operating system comes with file system API, but users choose whatever database they prefer, and database is implemented using file system API.
Mozilla people pushed really hard against "just use sqlite" because it's not a spec, and compatible alternatives would need to implement some of the quirks of sqlite. Unfortunately, nothing as good as sqlite has ever materialized, but this argument essentially blocked websql from becoming "officially blessed" by the w3c.
Around this time Mozilla was also was drinking the koolaid hard and somehow we ended up with something literally nobody wanted: indexeddb. There's a funny article which is made even better by it's earnest, unironic use of the term "aesthetics" to describe indexeddb [1].
Another tragic instance of design-by-committee and a complete lack of pragmatism.
[1] https://hacks.mozilla.org/2010/06/beyond-html5-database-apis...
I would love to see an SQL interface in the browser. I suppose it's going to be a library on top of indexed DB, and / or a WASM implementation. Then it would have a chance to become a standard.