RxDB local database and sync
RxDB describes itself as a local-first NoSQL database for JavaScript applications. It stores data on the client, in the browser, Node.js, React Native, Electron or Capacitor, as JSON documents in collections validated by JSON Schema. Queries use the Mango syntax, and every query is reactive, so the interface updates when the data changes.
Its sync engine replicates a collection with a backend. RxDB’s documentation stresses that the backend does not have to be RxDB: the protocol needs a push handler and a pull handler with checkpoints, so it can run over HTTP or GraphQL on top of Postgres, MongoDB or another database, and RxDB ships replication plugins for CouchDB, Firestore, Supabase, WebSockets and others. Conflicts are resolved on the client. By default the conflict handler keeps the server’s state, so a client that has been offline for a long time does not overwrite other people’s changes; you can supply your own handler.
RxDB also replicates between peers over WebRTC. Peers join a topic and connect to each other directly, but they first need a signaling server, or public or self-hosted Nostr relays, to find each other. RxDB’s documentation is direct about the limit: because peers still have to find each other through a signaling path, this is not a full offline mesh. Existing WebRTC connections keep replicating if the signaling server goes down, and peers on the same Wi-Fi or LAN can keep syncing.
Offline Protocol mesh SDK
Offline Protocol is a mesh SDK in the app on each device. In version 0.30.0 it is a React Native native module for iOS and Android, with a Rust core on crates.io, a Python package on PyPI, a Java package on Maven Central, a C API, early native Swift and Android packages and a preview Flutter plugin; it runs in native apps and gateways, not in a browser. Devices discover each other over Bluetooth LE with no access point, signaling server or internet, open MLS-encrypted sessions and groups, and exchange messages, replicated documents and service calls. Messages can be relayed across other devices to reach one out of direct range.
It is not a database. Documents hold maps, lists, text and counters that merge by a fixed rule per type, such as last writer wins per map key and counters that add up, and are read as JSON rather than queried.
RxDB vs Offline Protocol differences
RxDB is a local database with queries and backend replication whose peers meet through a signaling server or Nostr relays, while Offline Protocol is a mesh SDK whose devices find each other over Bluetooth LE and relay across multiple hops.
| RxDB | Offline Protocol | |
|---|---|---|
| What it is | A local database with queries and replication | A mesh SDK for messages, shared documents and service calls |
| Sync with a backend | Built in, against almost any backend you adapt | Not included; the app sends records to its own backend |
| How peers find each other | A signaling server or Nostr relays, then WebRTC | Bluetooth LE discovery, with no infrastructure |
| Relaying through other devices | Not described; peers connect to each other directly | Yes, multi-hop over the mesh |
| Conflicts | Resolved on the client; default keeps the server’s state | Fixed merge rule per collection type |
| Platforms (as of October 2026) | Browser, Node.js, React Native, Electron, Capacitor | React Native on iOS and Android; Rust; Python on PyPI; Java on Maven Central; a C API through offline_protocol.h in the desktop archives; early native Swift and Android packages; a preview Flutter plugin, not on pub.dev yet |
| Licensing (as of October 2026) | Core free under Apache 2.0; paid plans for premium plugins | Mesh SDK AGPL-3.0-only, or a commercial license |
RxDB and Offline Protocol pricing
RxDB and Offline Protocol both start free, with paid options on top. As of October 2026, RxDB’s core is free and open source under the Apache 2.0 license, including replication and realtime sync. Premium plugins come with paid plans billed annually: Pro from $99 a month, which adds storages including SQLite for React Native and WebCrypto encryption, Pro Plus from $239 a month, and custom Enterprise terms. RxDB’s plans price plugins, not the data you replicate; your backend and signaling server are yours to run.
The Offline Protocol mesh SDK is free under AGPL-3.0-only, including in production, when the app meets its obligations. Closed-source and App Store apps need the commercial license, which is annual with no published price. Traffic between devices over a local transport is never metered on any plan, so the handoffs and shared edits that crews exchange during a working day add nothing to the bill. Hosted services, such as a relay for when no local path exists, are optional and metered on plans from $0.
RxDB use cases
RxDB is the better fit when:
- You are building a JavaScript app, especially for the web, and want a reactive, queryable database on the client.
- Your data syncs with a backend you control, and you want to adapt the replication to it.
- Peer-to-peer sync is useful but a signaling path will be available when peers first meet.
Offline Protocol use cases
Offline Protocol is the better fit than RxDB when:
- Devices must find each other and coordinate where there is no Wi-Fi, signaling server or internet, such as a field site or a moving vehicle.
- Messages need to hop across several devices to reach one out of range.
- You want MLS end-to-end encryption between devices, with device identities that do not depend on a server.
RxDB and Offline Protocol in one app
In a React Native app, RxDB can be the local database and handle sync with your backend, while Offline Protocol carries shared state and messages between nearby devices. The app moves data between them: when a merged document changes, it writes the result into an RxDB collection, and RxDB replicates it to the backend once a connection exists. Keep each record’s source of truth on one path, so RxDB’s conflict handler and Offline Protocol’s merge rules never act on the same field.