Key points
- Backend database to devices: PowerSync (Postgres, MongoDB, MySQL, SQL Server into SQLite) and Firebase Cloud Firestore with offline persistence.
- Embedded database that also syncs device to device: Couchbase Lite and Ditto.
- JavaScript database with a pluggable backend: RxDB.
- Shared state and handoffs between nearby devices with no server: Offline Protocol, which is not a database.
- Realm’s Atlas Device Sync was removed in September 2025, so new projects should not plan around it.
Criteria for choosing an offline-first sync SDK
Four questions narrow the list of offline-first sync SDKs quickly:
- Where is the source of truth? A backend database you already run, the vendor’s server, or the devices themselves.
- Must devices sync with each other while offline? Most sync engines route every change through a server, so two phones in the same room do not see each other’s edits until both reconnect. Peer-to-peer sync vs cloud sync explains the difference.
- How are conflicts resolved? Last write wins per document, rules in your backend, CRDT merges, or custom resolvers. How are sync conflicts resolved? compares them.
- What do licensing and pricing count? Data synced, connected devices, monthly users, nodes, or nothing on the device path at all.
Offline-first sync SDK comparison table
| Source of truth | Device to device offline | Conflicts | Licensing (October 2026) | |
|---|---|---|---|---|
| PowerSync | Your Postgres, MongoDB, MySQL or SQL Server | No, client to server | Your backend decides | Client SDKs Apache-2.0; service under the Functional Source License or PowerSync Cloud |
| Firebase Cloud Firestore | Firestore backend | No, through Google’s servers | Last write wins per document | Proprietary managed service |
| Couchbase Lite | Couchbase Server or Capella | Yes, Multipeer replicator in native SDKs, small meshes | Deletes win, then latest local timestamp; custom resolvers | Community Edition Apache 2.0; Enterprise licensed |
| Ditto | Devices and Ditto Server | Yes, Bluetooth LE, LAN, AWDL, Wi-Fi Aware, Wi-Fi, with relaying | CRDT merge, causal consistency | Proprietary SDK |
| RxDB | Any backend you adapt | Over WebRTC after a signaling server or Nostr relays introduce peers | Resolved on the client | Core Apache 2.0; paid premium plugins |
| Offline Protocol | Your own backend; shared state lives on devices | Yes, Bluetooth LE mesh with relaying, or a hosted relay | Fixed merge rule per collection type | Mesh SDK AGPL-3.0-only, or commercial |
Best use for each sync SDK
PowerSync for getting each device its slice of an existing SQL or MongoDB database. Its service replicates your backend database into SQLite on each client and sends writes back through your own backend, which keeps control of validation. PowerSync describes itself as server-client sync with no peer-to-peer syncing. It lists client SDKs for the web, React Native and Expo, Flutter, Kotlin, Swift and more. As of October 2026, PowerSync Cloud has a Free plan and Pro from $49 a month, and a self-hosted Open Edition is free.
Firebase Cloud Firestore for apps already on Firebase that need to keep working through short outages. Offline persistence lets an app read, write, listen to and query a local cache and syncs changes when the device reconnects, with last write wins for competing changes to one document. Every change travels through Google’s servers. Firestore has a no-cost quota and pay-as-you-go pricing beyond it.
Couchbase Lite for native apps that want a full embedded database with SQL++ queries, server sync to Couchbase, and peer-to-peer replication for small groups. Its Multipeer replicator syncs over Wi-Fi and, since 4.1, Bluetooth LE. Couchbase’s React Native plugin is built on the Enterprise edition and does not support peer-to-peer sync as of October 2026.
Ditto for apps whose devices must sync with each other first, across Bluetooth LE and peer-to-peer Wi-Fi with relaying, on many platforms including Flutter and React Native. Documents are CRDTs queried with DQL. The SDK is proprietary, with a Free tier and Pro and Enterprise priced on request. Ditto vs Couchbase Lite compares the two in depth.
RxDB for JavaScript and TypeScript apps, including in the browser, that want reactive queries and replication with almost any backend through its sync protocol. Peers can also replicate over WebRTC once a signaling server or Nostr relays introduce them. The core is free under Apache 2.0; premium plugins such as the SQLite storage for React Native come with paid plans from $99 a month.
Offline Protocol for shared working state between devices that are near each other, such as a checklist two technicians edit in the same plant room or a job a driver hands to a yard operator, with no server in the path. It replicates documents of maps, lists, text and counters over a Bluetooth LE mesh or a hosted relay, encrypted with MLS, alongside messages and service calls. It has no query engine and does not sync a backend database, so it usually sits beside one of the options above. Traffic between devices over a local transport is never metered.
Realm and Atlas Device Sync replacements
MongoDB deprecated the Atlas Device SDKs and Device Sync in September 2024 and removed Device Sync on September 30, 2025. The Realm database itself continues as an open-source project, with community branches that remove sync. A Realm app that needs sync now has to pair Realm, or a replacement database, with one of the options above. MongoDB’s deprecation notice lists Ditto and PowerSync among the alternatives.
Testing sync SDKs before choosing
Run these sync SDK tests on real devices, not simulators:
- Edit the same record on two devices in airplane mode, reconnect them in both orders, and check the merged result.
- Keep one device offline for as long as your longest real outage, then reconnect it.
- Load the largest data set a device will hold and measure first sync and query times.
- Reinstall the app mid-sync and confirm nothing is lost or duplicated.
- For device-to-device sync, test across the exact phone models you deploy, including iPhone to Android.
How do you test an app for offline behaviour? covers each test in detail.
Offline Protocol for nearby-device coordination
Offline Protocol is on this list for one job: devices that must share state and hand off work directly while the backend is out of reach. It is not a replacement for a sync engine that brings your database to each device. Many apps will use PowerSync, Firebase, Couchbase Lite or Ditto for data, and Offline Protocol for coordination between the people and machines working side by side. The mesh SDK is free under AGPL-3.0-only when the app meets its obligations, and closed-source or App Store apps need the commercial license.