Local-first data

Offline Protocol vs RxDB

RxDB is a local-first NoSQL database for JavaScript apps that stores JSON documents on the client, answers reactive queries, and replicates with almost any backend through its sync protocol, or between peers over WebRTC once a signaling server or Nostr relays have introduced them. Offline Protocol is a mesh SDK, not a database, that lets nearby devices find each other over Bluetooth LE and exchange messages and shared documents with no network infrastructure at all. RxDB is the better fit for a JavaScript app that needs a queryable local database and backend sync, including in the browser. Offline Protocol fits devices that must coordinate where there is no network to signal through.

TL;DR

Pick RxDB for a JavaScript app, especially on the web, that needs a reactive, queryable local database and sync with a backend you control. Pick Offline Protocol when devices must find each other and coordinate with no Wi-Fi, signaling server or internet, or when messages hop across several devices. In a React Native app the two can work together.

Learning objectives

After reading this article you will be able to:

  • Describe how RxDB replicates with a backend and between peers over WebRTC
  • Compare RxDB and Offline Protocol on discovery, conflicts, platforms and licensing
  • Decide when to use RxDB, Offline Protocol, or both in one app

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.

RxDBOffline Protocol
What it isA local database with queries and replicationA mesh SDK for messages, shared documents and service calls
Sync with a backendBuilt in, against almost any backend you adaptNot included; the app sends records to its own backend
How peers find each otherA signaling server or Nostr relays, then WebRTCBluetooth LE discovery, with no infrastructure
Relaying through other devicesNot described; peers connect to each other directlyYes, multi-hop over the mesh
ConflictsResolved on the client; default keeps the server’s stateFixed merge rule per collection type
Platforms (as of October 2026)Browser, Node.js, React Native, Electron, CapacitorReact 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 pluginsMesh 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.

Frequently asked questions

Can RxDB sync two phones with no internet?

Not on its own. RxDB's WebRTC replication needs a signaling server, or Nostr relays, for peers to find each other, and RxDB's documentation says this makes it not a full offline mesh. Peers on the same Wi-Fi or LAN can keep replicating once connected, as long as a signaling path was available to introduce them.

Does Offline Protocol run in the browser like RxDB?

No. The Offline Protocol mesh SDK runs in native apps and gateway processes, not in a browser. RxDB runs in browsers, Node.js, React Native, Electron and Capacitor.

Does RxDB need an RxDB server for backend sync?

No. Its replication 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. RxDB also ships replication plugins for CouchDB, Firestore, Supabase, WebSockets and others.

How does RxDB resolve sync conflicts?

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, and you can supply your own handler.

How much does RxDB cost?

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, Pro Plus from $239 a month, and custom Enterprise terms.

Is Offline Protocol a database?

No. It is a mesh SDK, and its documents hold maps, lists, text and counters that merge by a fixed rule per type and are read as JSON rather than queried.

Sources

Build it with Offline Protocol

The shared state guide shows replicated documents syncing between two phones with the internet disconnected, the merge rule for each collection type, and how to scope which documents each device replicates.

Read the shared state guide