Web SQL Database: In Memoriam
nolanlawson.com
nolanlawson.com
The only thing preventing this from being practical is that sql.js weighs in at around 2MB. Still, there are caching mechanisms that could get around that issue.
I think it's fantastic that we've reached the point where we don't need databases baked into our browsers. All we need is fast JS engines (which we have) and a dumb data store (which we have), and we can provide our own client side databases.
Though it's a shame to need a 2MB database library to have a practical datastore.
It is needed to get a a particular database running, but I agree its awesome that the capabilities of the web are improving to the point this is possible.
It would be some work, but still be relatively trivial to build a query spec, probably based off of SQL 92, and a basic type system spec (Strings, numbers, and dates are the bulk of it), and then an implementation of everything else.
Facebook did it with Presto, although they haven't finished the DML part of it.
Reading the emails, I get the feeling most of the people involved didn't have as much experience with databases as they probably should have in order to make a truly informed decision.
When there's only one implementation (that authors care about), then every quirk, bug and accidental misfeature can be depended upon, and SQLite has plenty of those ("FLOATING POINT" parsed as "INT", magic of ROWID, the lax type system even more forgiving than PHP, etc.)
If there was another implementation then lack of overlap in quirks/bugs would prevent authors from depending on them (e.g. if you wrote something stupid then it'd work in one browser, but not the other).
ASCII venn diagram of 2 implementations:
{ bugs1 ( usable standard } bugs2 )
ASCII venn diagram of all browsers just shipping same Sqlite: {( usable: standard and all bugs })Although in general, it's sad that the "independent implementations" mantra basically guarantees a lack of consistency across browsers. It's like we only have a choice between "pointing to a pile of C code" or ending up with a pile of browser bugs. Maybe the W3C could write acceptance tests to go alongside the specs.
Like these? :) https://github.com/w3c/web-platform-tests
I read all the concerns (it's a standard built around sqllite, and who wants that?!?!, etc.) and I still sigh a sigh of disappointment that it's come to this. I know, Web SQL isn't going away, as the author points out, but it will be a 2nd class citizen for the foreseeable future, and that's just a missed opportunity, imho.
Web SQL is definitely dead in native Chrome apps. It was never born actually given IndexedDB was the only solution that was pushed.
I think this articles kicks on one key thing that explains the lack of enthusiasm around IndexedDB... people primarily want a database on mobile. And iPhone doesn't support IndexedDB yet, that is enough to kill it.
Perl is obsolete? LOLz.