Sync / Editing server data

When to use this pattern, and who owns what

SituationUseWho owns the fact
Online table edits; cached view is disposableRemote mutationServer; optimistic layer clears on settle
Single write that must survive reload offlineDurable Remote mutation (outbox)Server; outbox retries until answered
Shared state small enough for every clientSync sliceDurable journal; every replica holds it
Large table with offline cell editsJournal + read-model tableJournal owns edits; table derives from them

In the journal-and-table pattern, ownership splits cleanly:

  • The journal owns every edit. Each edit is a durable Message committed in one global order and stamped with its sequence (at) and author (by).
  • The SQL table is a derived read model. Only the journal updates it, writing each committed change alongside the highest sequence applied to that row (revision). You can rebuild the table at any time from its seed plus the log.
  • Remote caches the table's rows as it caches any server-owned read.
  • The replicated slice holds only unabsorbed edits—edits still in flight or not yet folded into the table—so the slice stays tiny.