data-storage / library
Dexie.js
Capability: Dexie.js
Use it when
- Your PWA or web app needs structured offline storage with indexes and queries, and raw IndexedDB code has become a tangle of transactions, event callbacks, and browser quirks.
- You are storing app data client-side in Electron or Capacitor apps and need bulk writes, indexed range queries, and live queries that update React components as data changes.
What it solves
Not the fit when
- server-side databases; it wraps the browser's IndexedDB
- multi-device sync, auth, or collaboration without the separate Dexie Cloud service
- legacy dexie-observable and dexie-syncable addons are deprecated and unmaintained
- server-side persistence
- cross-device sync, authentication, or collaboration without the separate Dexie Cloud addon
- relational SQL querying
Install
npm install dexie # or import from https://unpkg.com/dexie/dist/modern/dexie.mjs
Invoke
import { Dexie } from 'dexie'; const db = new Dexie('FriendDatabase'); db.version(1).stores({friends: '++id, age'}); await db.friends.add({name: 'Alice', age: 21}); const young = await db.friends.where('age').below(30).toArray();Alternatives
No reviewed alternatives recorded yet.