[w3c/IndexedDB] Prebuilt IndexedDB format (#224)

Shipping prebuilt SQLite databases is a common pattern in native/hybrid apps (e.g. see [this](https://pouchdb.com/2016/04/28/prebuilt-databases-with-pouchdb.html), [this](https://www.concretepage.com/android/android-ship-sqlite-database-with-apk-copy-sqlite-database-from-assets-folder-to-data-example), [this](https://www.appcoda.com/core-data-preload-sqlite-database/), [this](http://blog.qmatteoq.com/import-an-already-existing-sqlite-database-in-a-windows-8-application/)). Currently this can be "done" on the web, but you essentially have to build up an entire IDB database on first load (slow) and then invalidate/mutate it when the underlying data store changes (slow, error-prone).

What if instead we had a standard file format for an IndexedDB database, which could be quickly loaded into the browser and accessed in a read-only way? It could be a single file, which would be fetched and cached like any other resource. All processing to convert to the underlying LevelDB/SQLite/ESE format could be done on a background thread.

Use cases:

- emoji library (most web emoji libraries run in-memory, despite the large number of emoji)
- full-text search index for a card game app
- schedule database for a conference app

It's debatable whether the database should be read-only or not, since I've seen cases where a prebuilt database is just used as a starting point for the app (e.g. a Pokédex app where the user can favorite each Pokémon), but for a v1, just keeping it read-only may be very useful. Potentially this could even encourage websites to use less memory (e.g. for the emoji use case).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/224

Received on Tuesday, 7 November 2017 23:59:49 UTC