rxdb
The local-first database that runs on every JS runtime and replicates with your existing backend - no vendor, no lock-in - https://rxdb.info/
What is rxdb?
The local-first database that runs on every JS runtime and replicates with your existing backend - no vendor, no lock-in - https://rxdb.info/
Overview of rxdb
What it is
RxDB (Reactive Database) is a local-first, NoSQL-database for JavaScript applications. It is reactive, meaning you can not only query the current state but also subscribe to all state changes, such as the result of a query or a single field of a document. It runs on any JavaScript runtime, including browsers, Node.js, React Native, Capacitor, NativeScript, Flutter, and Electron.
Key features
- Reactive: subscribe to state changes (query results, document fields)
- Multiplayer realtime applications support - Replication with existing infrastructure via a simple Sync Engine (HTTP endpoints); plugins for GraphQL, CouchDB, Websocket, WebRTC (P2P), Supabase, Firestore, NATS, Google Drive - Flexible storage layer: swap underlying storage (LocalStorage, IndexedDB, OPFS, LokiJS, Dexie.js, in-memory, SQLite, WebWorker, FoundationDB, DenoKV)
- Features include logging, attachments, ORM, conflict handling, middleware, signals, TanStack DB, state backup, replication, server, storages, local documents, schema validation, compression, migration, encryption, CRDT, population - Proven technology used by thousands of developers worldwide
Use cases
- Multiplayer realtime applications - Applications that need to replicate with existing backend infrastructure without vendor lock-in - UI-based realtime applications that benefit from reactive data subscriptions - Applications running in diverse JavaScript environments (browser, Node.js, React Native, etc.)
Getting started
Install: sh npm install rxdb rxjs --save Example usage (store data): javascript import { createRxDatabase } from 'rxdb/plugins/core'; import { getRxStorageLocalstorage } from 'rxdb/plugins/storage-localstorage'; const db = await createRxDatabase({ name: 'heroesdb', storage: getRxStorageLocalstorage() }); await db.addCollections({ heroes: { schema: { version: 0, primaryKey: 'name', type: 'object', properties: { name: { type: 'string', maxLength: 100 }, healthpoints: { type: 'number' } }, required: ['name', 'healthpoints'] } } }); await db.heroes.insert({ name: 'Bob', healthpoints: 100 }); For querying and observing, see the repository README.
License and pricing
License: Apache-2.0. Pricing: open source (free).
Based on the project's public README and repository metadata.