IndexedDB
The browser's built-in asynchronous, transactional database for storing large amounts of structured data, including files and binary data.
In more detail
Data lives in object stores inside a versioned database per origin; every read and write happens in a transaction and results arrive through events. It can hold far more than localStorage and does not block the main thread.
Related terms
- object store — The IndexedDB equivalent of a table: a named collection of records, each found by its key.
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- index — A separate, sorted structure a database keeps alongside a table so it can find matching rows without reading them all.
- cursor — An object that walks through the records of an object store or index one at a time, in key order.
- upgradeneeded event — The IndexedDB event fired when a page opens a database with a higher version number than the stored one, the only place the schema can change.
Taught in
- Client Storage Paradigms: Cookies, Storage Tradeoffs — Frontend Architecture & Web Platform
- IndexedDB In Practice: Object Stores, Indexes And Transactions — Frontend Architecture & Web Platform
- Background Sync, Push Notifications And PWA Manifests — Frontend Architecture & Web Platform