Sync / Editing server data
When to use this pattern, and who owns what
| Situation | Use | Who owns the fact |
|---|---|---|
| Online table edits; cached view is disposable | Remote mutation | Server; optimistic layer clears on settle |
| Single write that must survive reload offline | Durable Remote mutation (outbox) | Server; outbox retries until answered |
| Shared state small enough for every client | Sync slice | Durable journal; every replica holds it |
| Large table with offline cell edits | Journal + read-model table | Journal 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
Messagecommitted 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.