Web SQL Database

2009 - 2023
dead
one implementation was the whole problem. web sql put a real sqlite database behind a javascript call, and every browser that shipped it shipped sqlite underneath. mozilla refused to standardize a spec whose only definition was whatever sqlite happened to do that year, so the w3c stopped work in november 2010 and pointed everyone at indexeddb. the api kept running in shipping browsers for thirteen more years before chrome 119 switched it off.

~ the last words ~

The W3C note that killed Web SQL is short enough to read in a minute and it is still online. Dated 18 November 2010, it says the specification reached an impasse: every interested implementor had used the same SQL backend, and multiple independent implementations were needed to move any further. That was the obituary, published thirteen years before the thing actually stopped working.

What it described was a web page with a real relational database inside it. You called openDatabase, got a handle back, opened a transaction, and passed SQL strings into it. Safari shipped an implementation in 2008 and Chrome followed in January 2010, which meant that for a stretch of the early mobile web this was the only serious way to keep structured data on a phone between page loads. Ian Hickson wrote the spec at Google and the first public working draft went up on 23 April 2009.

The problem was underneath. Every browser that implemented it did so by embedding SQLite, so the specification could not actually say what the SQL dialect was. It could only point. Mozilla argued in 2010 that ratifying this would write one library's quirks into the web platform permanently, refused to ship it, and pushed IndexedDB instead. The working group agreed with the objection and put its pens down.

Browser storage was never my end of the stack. I read the argument the way you read a court ruling from another country, where the reasoning is legible and the stakes belong to somebody else. What stayed with me was the shape of the finding. A thing can ship widely and still fail to be a standard, because standard means two people arrived at the same behavior separately.

~ the record ~

Born23 April 2009, first public working draft at the W3C
Peakthe offline storage layer under most of the early mobile web
Killed31 October 2023
Lifespan14 years
Made byIan Hickson, for the W3C Web Applications Working Group
Killed byIndexedDB, and a spec that could only point at SQLite

~ what openDatabase did ~

The API was four calls wide. openDatabase took a database name, a version string, a display name and an estimated size in bytes, then handed back a database object. transaction opened a scope, executeSql ran a statement inside it, and rows came back through callbacks in a list you indexed by number.

The version string is the part people remember badly. You declared which schema version you expected, and if the stored database was on a different one the open failed and you were supposed to call changeVersion to migrate. In practice most apps passed an empty string, skipped versioning entirely, and handled schema changes with a CREATE TABLE IF NOT EXISTS wrapped in a try. PhoneGap and Cordova apps shipped that pattern by the thousand.

~ the SQLite problem ~

SQLite is public domain and small enough to embed anywhere, which is exactly why every browser vendor reached for it and exactly why the spec could not be written. If a standard defines behavior by reference to one implementation, a bug fix in that implementation silently changes the web platform, and a page that worked last year breaks when a browser bumps its bundled copy.

The spec did not hide this. One line in the text reads: user agents must implement the SQL dialect supported by Sqlite 3.6.19. A version number, in a W3C document, standing in for the definition of a language. IndexedDB, the alternative, is a key-value store with indexes and cursors and no query language at all. Developers found it miserable to use, and it had the single property that mattered, which is that two teams could implement it from the text and land in the same place.

~ thirteen years of afterlife ~

The spec was dead in 2010 and the code was not. Chrome kept shipping it because sites used it, sites kept using it because Chrome shipped it, and that loop held for more than a decade. WebKit removed its implementation in 2019. Chrome took it out of third-party contexts in version 97, then out of insecure contexts in 110, then switched it off by default for everyone in Chrome 119 on 31 October 2023.

A deprecation trial kept it alive for registered sites through Chrome 123, and Chrome 124 pulled the code in April 2024. Android's WebView carried it furthest of anything: version 133 was the last Chromium build in which openDatabase returned anything at all.

~ leave a rose ~

an anonymous tribute. one rose per visitor per day.

@}-->-- ... roses left here

~ leave a wreath ~

a rose fades by morning. a wreath stays on this grave for good, with your name on it.

from $1, paid once through stripe. it keeps the graveyard running: the hosting and the nightly digging. adopt it and the headstone reads "maintained in memory by" you. the groundskeeper plants new wreaths at the next tending, usually within a day.

» one email a week: new graves and the anniversaries of the dead. subscribe

~ leave a note ~

visitors before you have left these graveside notes. anonymous welcome.

other protocols: Microsoft ActiveX, VideoCipher, Do Not Track, X.25

also died in the 2020s: Google Code Jam, Tumblr Live, VPNLab

« previous  ·  random  ·  next »