bricolage

Local-First Software: Apps, Databases, and Sync Engines

What is local-first software?

Local-first software keeps application data in a local database on each device, then uses a sync engine to replicate changes between devices and servers. Reads and writes stay fast, apps can work offline, and real-time or multiplayer features become part of the data layer instead of custom network code.

How does a local-first app work?

The app reads from and writes to a database on the device. A sync engine moves those changes between local databases and a server, so the interface can respond without waiting for the network and sync after a device reconnects.

What is a sync engine?

A sync engine is the replication layer in a local-first app. It sends local changes to other copies of the data, applies incoming changes, and handles reconnecting or conflicting edits. The exact guarantees vary by system.

Examples and implementation notes

These essays trace the architecture from a broad explanation to concrete experiments with CRDTs, ElectricSQL, and data-first app development.

Read the collection

Some notes on Local-First Development

September 8, 2023

Local-first shifts reads and writes to client databases synced by engines. A major paradigm shift ahead.

Announcing trpc-crdt

November 10, 2023

Run tRPC server calls over CRDT sync engines like Yjs and ElectricSQL for resilient, real-time RPCs.