← Lessons

quiz vs the machine

Platinum1800

System Design

Server Reconciliation in Collaboration

How the server orders edits and reconciles each client to truth.

6 min read · advanced · beat Platinum to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. What does the server assign to define one true order?

2. What do clients do after the server confirms an edit?

3. Why apply edits optimistically before the server replies?