Local-first software

Local-first software is software that keeps the primary copy of a user's data on their own devices, so it works fully offline and syncs with other devices and collaborators when a connection exists. The term comes from a 2019 Ink & Switch essay by Martin Kleppmann, Adam Wiggins, Peter van Hardenberg, and Mark McGranaghan. Merging concurrent edits, usually with CRDTs, is what makes it practical.

How it works

In a local-first app, reads and writes go to storage on the device first. The network is used to exchange changes with other replicas, not to ask a server for permission, so the app responds at once and keeps working with no connection.

Because several devices can edit the same data while apart, local-first apps need a merge strategy. Most use CRDTs, data types whose merge rule guarantees every replica converges to the same state whatever order changes arrive in. Sync can run through a server, directly between devices, or both.

Why it matters

The Ink & Switch essay sets out seven ideals: no spinners, work not trapped on one device, the network is optional, seamless collaboration, the long now, security and privacy by default, and ultimate ownership and control. Apps that need a server round trip for every action meet few of them.

For field work it is the difference between a tool that stops in a dead zone and one that keeps recording and reconciles later. The cost is complexity: conflict handling, storage on the device, and schema changes across replicas that update at different times.

How it relates to Offline Protocol

Offline Protocol's replicated documents are a local-first building block: map, list, text, and counter documents persist on the device, accept edits offline, and merge deterministically when replicas meet, exchanged as deltas inside MLS-encrypted groups over the mesh.

It is not a database: there is no query language, the storage underneath is a swappable adapter, and your existing backend stays the system of record. See offline-first architecture and the offline sync alternatives.

Frequently asked questions

What is the difference between local-first and offline-first?

Offline-first means an app keeps working without a connection, often by caching server data and replaying writes later. Local-first goes further: the copy on the device is the primary one, devices can sync with each other, and users keep working and keep their data even if the vendor's server goes away.

Do local-first apps need CRDTs?

Not strictly, but most use them, because CRDTs merge concurrent edits from many devices without a central server choosing a winner. Alternatives include operational transformation, which usually needs a server, and merge rules specific to the app.

Can Offline Protocol sync local-first data between phones without a server?

Yes. Replicated documents merge device to device over whatever transport is available, with no hosted component in the data layer, and your backend stays the system of record.

Keep working when the network does not. 350,000+ devices, 140+ countries.