Local-first architecture
Putting the application’s read/write database on the client and treating the server as a sync and durability layer rather than the system of record. Every query and mutation hits a local store (in practice SQLite in the browser or app), so the user never waits on the network, and the app keeps working offline rethinking-data-client-event-sourcing.
This is a third pole on the spoke’s embedded↔distributed axis. turso shrinks the OLTP engine into the server process; local-first pushes it one hop further, into the user’s process.
What it changes
- The three-tier stack collapses. Centralized DB + API tier + thin client becomes local DB + sync protocol. The API tier stops being where reads are served.
- Latency stops being a design constraint on UX. Writes are local and immediate; conflict resolution moves to the sync layer instead of being avoided by a round trip.
- Schema design moves to the front. A single monolithic schema can’t be synced usefully. It has to be cut into units small enough to sync and own independently, which is why the decision is hard to reverse later.
- Data ownership becomes achievable. The user can hold the whole store: the event log or the materialized SQLite file.
The two sync mechanisms
- event-sourcing — sync an immutable log of events, materialize local state from it (livestore).
- CRDTs — sync mutable data structures that merge concurrently (Automerge, Yjs, Loro).
A third approach syncs queries rather than either: ElectricSQL, PowerSync and Zero stream query-scoped rows to a client-side cache. The sync engine, not the database, is the interesting component in all three.
Where it’s the wrong choice
Not universal, on its proponents’ own account: systems needing global consistency over responsiveness (financial), social graphs where per-user data boundaries are unclear, and anything where the UX isn’t the deciding concern. The cost is paid in data modelling.
Related
event-sourcing · livestore · rethinking-data-client-event-sourcing · operational-databases · online-transaction-processing · turso · johannes-schickling