the lab
note

Sync architecture sketch

Working notes on the sync layer. SQLite + a tiny relay; CRDT on top; end-to-end encrypted.

August 4, 2025 updated October 15, 2025 ↳ locust local first

A short, deliberately scrappy note that I keep updating in place rather than re-writing as essays. The full essay version, when it arrives, should live in Locust.

Storage

  • Local: SQLite with WAL. One file per workspace.
  • Wire format: Automerge documents, one per article-or-collection.
  • Encryption: end-to-end, key derived per workspace; the relay never sees plaintext.

Sync

  • Topology: not p2p. A trusted relay; clients connect when online.
  • Liveness: the relay nudges connected clients with new ops. No long polling.
  • Backpressure: clients can pause sync per-workspace, which is also how you “freeze” a draft.

Not yet decided

  • Whether to ship attachments through the same relay or via a content-addressable blob store.
  • How much of the version history to keep on-device by default. Three months feels right; a year feels excessive.

See also: the Merge conflicts as design essay for what the user sees when sync surfaces a divergence.