Offline-first and sync

What are the best offline-first sync SDKs for mobile apps?

Offline-first sync options for mobile apps in 2026 include PowerSync and Firebase's Cloud Firestore for syncing a backend database to devices, Couchbase Lite and Ditto for an embedded database that also syncs directly between devices, RxDB for JavaScript apps with a pluggable backend, and Offline Protocol for shared state and handoffs between nearby devices with no server. There is no single best one; the right choice follows where your data lives and whether devices must sync with each other while offline.

TL;DR

Offline-first sync SDKs keep a copy of data on the device and reconcile it later. They split by where the reconciliation happens.

Learning objectives

After reading this article you will be able to:

  • Apply four criteria that separate offline-first sync SDKs
  • Match PowerSync, Firebase, Couchbase Lite, Ditto, RxDB and Offline Protocol to the jobs they fit
  • Plan the tests to run before committing to one

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:

  1. Where is the source of truth? A backend database you already run, the vendor’s server, or the devices themselves.
  2. 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.
  3. 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.
  4. 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 truthDevice to device offlineConflictsLicensing (October 2026)
PowerSyncYour Postgres, MongoDB, MySQL or SQL ServerNo, client to serverYour backend decidesClient SDKs Apache-2.0; service under the Functional Source License or PowerSync Cloud
Firebase Cloud FirestoreFirestore backendNo, through Google’s serversLast write wins per documentProprietary managed service
Couchbase LiteCouchbase Server or CapellaYes, Multipeer replicator in native SDKs, small meshesDeletes win, then latest local timestamp; custom resolversCommunity Edition Apache 2.0; Enterprise licensed
DittoDevices and Ditto ServerYes, Bluetooth LE, LAN, AWDL, Wi-Fi Aware, Wi-Fi, with relayingCRDT merge, causal consistencyProprietary SDK
RxDBAny backend you adaptOver WebRTC after a signaling server or Nostr relays introduce peersResolved on the clientCore Apache 2.0; paid premium plugins
Offline ProtocolYour own backend; shared state lives on devicesYes, Bluetooth LE mesh with relaying, or a hosted relayFixed merge rule per collection typeMesh 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:

  1. Edit the same record on two devices in airplane mode, reconnect them in both orders, and check the merged result.
  2. Keep one device offline for as long as your longest real outage, then reconnect it.
  3. Load the largest data set a device will hold and measure first sync and query times.
  4. Reinstall the app mid-sync and confirm nothing is lost or duplicated.
  5. 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.

Frequently asked questions

What is the best offline-first database for React Native?

It depends on the sync you need. PowerSync, Ditto and RxDB list React Native support with sync to a backend or server. Couchbase's React Native plugin does not support peer-to-peer sync as of October 2026. Offline Protocol is a React Native module for device-to-device state and messaging, not a database.

Which offline-first SDKs sync directly between phones?

Ditto, Couchbase Lite (through its Multipeer replicator in the native SDKs) and Offline Protocol sync devices directly with each other. RxDB connects peers over WebRTC once a signaling server or Nostr relays introduce them. PowerSync and Firebase sync through their servers only.

What replaced Realm and Atlas Device Sync?

MongoDB removed Atlas Device Sync on September 30, 2025, and the Realm database continues as an open-source project without sync. MongoDB's deprecation notice lists alternatives including Ditto and PowerSync. Couchbase Lite and Firebase are other options, depending on the backend.

Which offline-first sync SDKs are open source?

As of October 2026, RxDB's core is Apache 2.0, PowerSync's client SDKs are Apache-2.0 with its service under the Functional Source License, Couchbase Lite's Community Edition source is Apache 2.0, and Offline Protocol's mesh SDK is AGPL-3.0-only with a commercial license. Ditto's SDK and Firebase's backend are proprietary.

How should I test an offline-first sync SDK?

Put two real devices in airplane mode, edit the same record on both, reconnect them in different orders, and check the result against what your users expect. Then test a long offline period, a reinstall, and the largest data set a device will hold. How do you test an app for offline behaviour? covers the full list.

Build it with Offline Protocol

If devices in your app must share state with each other while offline, the shared state guide shows Offline Protocol's replicated documents syncing between two devices with the internet disconnected, and the interruptions to test before relying on it.

Read the shared state guide