KV storage
- Category
- Offline / Storage
- Type
- New or changed feature
- Status
- No longer pursuing (Chrome No longer pursuing)
- Intent stage
- Prepare to ship
WPT details: https://github.com/web-platform-tests/wpt/tree/master/kv-storage
Summary
KV storage provides a simple, asynchronous key/value store with a modern API. Additionally, it allows easy creation of isolated storage areas beyond the default one. KV storage is layered on top of IndexedDB, storing its data in a specific database, so the developer can fall back to using IndexedDB directly when necessary.
Motivation
As explained in Mozilla's 2012 article, "There is no simple solution for local storage", the web today has no good key/value store. Local storage itself is synchronous, leading to performance issues and cross-window synchronization problems. Developers often use it anyway, leading to subpar web experiences. Other developers use libraries like localForage or idb-keyval to get around this problem. We've taken inspiration from their work to build KV storage.
Standards & signals
- Specification: https://wicg.github.io/kv-storage/
- Firefox: Closed Without a Position
- Safari: No signal
- Web developers: Positive
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=931263
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=kv-storage
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+KV%20storage
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=KV%20storage
- Baseline status: https://webstatus.dev/?q=KV%20storage
Docs: https://developers.google.com/web/updates/2019/03/kv-storage
Samples: https://rollup-built-in-modules.glitch.me/
Explainers: https://github.com/WICG/kv-storage/blob/master/README.md