Rendering and architecture · Pattern

Local-first

Apps that keep the main copy of your data on your own device, so they respond instantly and work offline, and sync with other devices and people in the background.

Patterns · updated

How it works

A local-first app reads and writes a database on the device, such as SQLite or IndexedDB, so every action is immediate and nothing waits on the network. A sync engine sends changes to a server or to other devices whenever a connection exists. When two people edit the same thing offline, conflict-free replicated data types (CRDTs), used by libraries such as Yjs and Automerge, or rules on the server merge the edits.

The term comes from a 2019 essay by the research lab Ink & Switch, and apps such as Linear and Obsidian are often cited as examples. Sync services such as PowerSync, ElectricSQL and Dexie Cloud do much of the hard work for web and mobile apps. It changes the role of the backend: the server becomes a place to sync and back up, not the only source of truth.

Local-first pros and cons

Pros

  • Instant responses, because nothing waits for the network
  • Works fully offline and on poor connections
  • Users keep their data even if the service changes
  • Real-time collaboration follows naturally from sync

Cons

  • Sync and conflict resolution are hard to get right
  • Access control and data migrations are more complex
  • Large datasets may not fit on every device

When to use Local-first

Pick it when

  • Notes, task and field-work apps used offline or on the move
  • Collaborative editors and design tools
  • Apps where the speed of every interaction matters

Skip it when

  • Data that must be checked centrally first, such as payments or stock levels
  • Simple content sites or forms with little data to keep

More in Rendering and architecture

Patterns

All 16 Rendering and architecture terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.