Architecture walkthrough

How the sync engine works

From a keystroke on one device to the same text on every other, in under 200 milliseconds.

Put the pipeline in order

  1. Capture the change on the device
  2. Queue it locally, even when offline
  3. Merge it on the server with other edits
  4. Broadcast the result to every device

Match each component to its job

journal
merger
fanout
Keeps changes safe while offline
Resolves edits made at the same time
Pushes updates to connected devices

Push beat polling at every percentile

Illustrative benchmark ยท switch views above

Why push, not polling

Polling

  • Devices ask every two seconds
  • Most requests return nothing
  • Battery and server cost add up

Push

  • Server sends only real changes
  • One open connection per device
  • Updates in milliseconds

Check

Two people edit the same line at once. Which component decides the result?

  1. journal
  2. fanout
  3. merger

The merger resolves concurrent edits before anything is broadcast.

Questions?

Design doc and runbooks are linked in the engineering wiki.