The server as authority
In many collaborative systems the server is the source of truth. It assigns each accepted operation a sequence number, defining the one true order, and every client reconciles its local view against that order.
Optimistic local apply
Clients apply edits optimistically for instant feedback, then send them to the server. The server may transform the edit against operations it sequenced first and broadcasts the canonical result. Each client then rebases its unacknowledged edits on top of what the server confirmed.
Acknowledgement and rollback
- An ack carries the server sequence number so the client can drop the matching pending edit.
- If the server transformed the edit, the client reapplies its remaining pending operations onto the new base.
This client prediction with server reconciliation loop, borrowed from networked games, hides latency while keeping one authoritative history.
Key idea
The server sequences and reconciles every edit while clients apply optimistically and rebase pending operations onto the confirmed base.