DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

RxDB


RxDB (Reactive Database) is a local-first, NoSQL document database for JavaScript applications. It runs inside the application itself (browsers, Node.js, Electron, React Native, Capacitor, Deno, and other JavaScript runtimes) and lets developers subscribe to queries and individual document fields so that the UI updates in real time whenever the data changes. Documents are stored as JSON, collections are defined with JSON Schema, and queries use a MongoDB-like (Mango) query syntax.[01][05][02]

Source Code
https://github.com/pubkey/rxdb[02]
Developer
Country of Origin
DE
Start Year
2016 [08]
Coding Agents
Project Types
Commercial, Open Source
Supported Languages
JavaScript, TypeScript
Embeds / Uses
FoundationDB, MongoDB, SQLite
Inspired By
CouchDB, PouchDB
License
Apache v2
Twitter
@rxdbjs[04]

RxDB does not store data itself. Instead, it uses a pluggable RxStorage layer, with implementations for IndexedDB, OPFS, LocalStorage, in-memory, the Node.js filesystem, SQLite, Dexie.js, MongoDB, and FoundationDB. Wrapper plugins add encryption, key compression, sharding, and execution inside Web Workers or SharedWorkers.

RxDB ships its own replication protocol that can sync with any backend. Official replication plugins exist for HTTP, GraphQL, CouchDB, WebSocket, WebRTC (peer-to-peer), Firestore, Supabase, MongoDB, and NATS. RxDB does not support multi-document transactions: a single document write is the only atomic operation. Writes are checked against the document's revision, and replication conflicts are resolved on the client with a configurable conflict handler.

Database Entry

RxDB


RxDB (Reactive Database) is a local-first, NoSQL document database for JavaScript applications. It runs inside the application itself (browsers, Node.js, Electron, React Native, Capacitor, Deno, and other JavaScript runtimes) and lets developers subscribe to queries and individual document fields so that the UI updates in real time whenever the data changes. Documents are stored as JSON, collections are defined with JSON Schema, and queries use a MongoDB-like (Mango) query syntax.

RxDB does not store data itself. Instead, it uses a pluggable RxStorage layer, with implementations for IndexedDB, OPFS, LocalStorage, in-memory, the Node.js filesystem, SQLite, Dexie.js, MongoDB, and FoundationDB. Wrapper plugins add encryption, key compression, sharding, and execution inside Web Workers or SharedWorkers.

RxDB ships its own replication protocol that can sync with any backend. Official replication plugins exist for HTTP, GraphQL, CouchDB, WebSocket, WebRTC (peer-to-peer), Firestore, Supabase, MongoDB, and NATS. RxDB does not support multi-document transactions: a single document write is the only atomic operation. Writes are checked against the document's revision, and replication conflicts are resolved on the client with a configurable conflict handler.[01][05][02]

History[02][05]


Daniel Meyer started RxDB in 2016 as a reactive layer on top of PouchDB, which provided both its storage and its CouchDB-compatible replication. LokiJS was later added as an alternative in-memory backend.

Later major versions replaced these dependencies with RxDB's own abstractions: the RxStorage interface made the underlying storage engine fully swappable, and a custom replication protocol made it possible to sync with arbitrary backends rather than only CouchDB. The PouchDB and LokiJS storages were eventually dropped in favor of storages such as IndexedDB, OPFS, SQLite, and Dexie.js.

The core project is open source under the Apache 2.0 license. Some storages and plugins (for example the SQLite and the optimized IndexedDB storages) are sold commercially as RxDB Premium.

Concurrency Control[06]


Every document carries a revision (_rev). A write must reference the revision it was based on; if that does not match the stored revision, RxDB rejects the write with a 409 CONFLICT error. Helpers such as incrementalModify() re-apply the change to the latest document state instead of failing. There are no locks and no multi-document transactions.

Data Model


Fault Tolerance[06][07]


Clients replicate asynchronously with a backend through RxDB's replication protocol and can keep working offline. When the backend reports a conflict, it returns its current document state and the client resolves it with a conflict handler (isEqual() / resolve()); the default handler keeps the server state.

Isolation Levels[06]


RxDB does not support transactions; a single document write is the only atomic operation.

Joins


Query Interface


Storage Format[05]


Documents are JSON objects validated against a JSON Schema. How they are laid out on disk depends on the selected RxStorage (e.g., IndexedDB, OPFS, SQLite).

Compatible Systems
SignalDB SignalDB

Citations

10 sources
  1. RxDB - JavaScript Database rxdb.info
  2. GitHub - pubkey/rxdb: A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/ · GitHub github.com
  3. RxDB Docs | RxDB - JavaScript Database rxdb.info
  4. https://twitter.com/rxdbjs twitter.com
  5. https://rxdb.info/rx-storage.html rxdb.info
  6. https://rxdb.info/transactions-conflicts-revisions.html rxdb.info
  7. https://rxdb.info/replication.html rxdb.info
  8. INIT: REPO-SWITCH github.com
  9. https://github.com/pubkey/rxdb/commit/94fddf91e52b0dc7165188fec11ebf6de6f05ec6 github.com
  10. https://github.com/pubkey/rxdb/commit/09b6df43e6be16b31e25be210863a4701f3ba3c0 github.com
Revision #8