TSTier SlateAll templates
  1. Home
  2. Templates
  3. Whiteboard sync

Collaboration

Whiteboard sync - the cursors cost more than the drawing

Why a shared canvas is mostly a broadcast problem, and what happens to a shape that two people grab at once.

  • System design
  • core
  • 9 step walkthrough
  • 5 tables
Own this board 400 creditsPractise as an interview

The first act plays here. Owned once with credits, never a subscription.

Share

  • Facebook
  • X

What this board gets wrong on purpose

The tension

A drag emits twenty-five absolute-position ops a second, and last-writer-wins resolves each of them by arrival order - so two people dragging one shape produce a tug of war at 25 Hz that ends wherever the network left it, not where either person meant. The board softens that with a drag claim broadcast on the PRESENCE channel, which is exactly the channel that is unacknowledged, unordered and allowed to drop frames: two people who grab the same shape inside one 60 ms presence window both believe they hold it, and the claim is advisory anyway because a server that enforced it would have to keep per-shape lock state and decide what happens when the holder’s laptop closes. The honest fix is intent-carrying ops - "move by this delta", or a claim on the ordered channel with a server-side lease - and both cost a round trip on the one interaction that has to feel like direct manipulation. Underneath all of it the room is one process holding the board in memory with a 250 ms debounce to storage, so a deploy disconnects everyone and an unclean kill loses the last quarter second of every board on the machine.

Practise this as an interview

Take Whiteboard sync - the cursors cost more than the drawing as a timed system design interview on a blank board - on your own, with the requirements to check yourself against, or with a candidate you invite.

Practise this as an interview

Start here

Why this design

A shared whiteboard looks like a collaborative editing problem and is mostly a broadcast problem: cursors and viewports outweigh the actual edits twelve to one. Interviewers use it to see whether you size the right pipe, whether you know what a single-writer room buys and what it costs at deploy time, and whether you can say precisely what happens when two people drag one shape. The same questions arrive in any product that grows live presence - multiplayer cursors in a document editor, a design tool, a game lobby.

What you will learn

  • Why 60 pointer events a second are coalesced over a 40 ms window into 25 ops, and why the receiver, painting at 60 fps, cannot tell.
  • How presence (16.3M frames/s) outweighs ops (1.3M/s) twelve to one, grows with the square of the room, and is cut from 782 MB/s to 174 MB/s by viewport culling and rate adaptation.
  • Why one process per board with one revision counter is the cheapest total order, and what it costs: a 250 ms unsaved window, a drain on every deploy, and a 22 MB rejoin at p99.
  • Why last-writer-wins on absolute positions turns two simultaneous drags into a 25 Hz tug of war, and what the two real fixes - delta ops or a leased claim - each cost.
  • Why keeping only the first and last op of each drag shrinks the op log by 94%, from 395 GB to 24 GB a day.
  • Which channel may drop data under load (presence) and which never may (ops), and how each one degrades.

How to read this board

  1. The diagram, left to right: PEOPLE, then THE CLIENT (60 fps locally, 25 ops on the wire), then THE ROOM (one writer, one rev counter).
  2. Below them, TWO FAN-OUTS: ops on the left, presence on the right - drawn the same size although presence is twelve times bigger - and the red Last writer wins box where the conflict happens.
  3. The right-hand column: DURABILITY, then DERIVED. Press play for the nine-step walkthrough, which follows one drag and then the collision.
  4. Page 1 · Requirements - the questions that change the design, and the latency targets.
  5. Pages 2 and 3 · Capacity and Storage - where the twelve-to-one ratio and the 94% op-log collapse come from.
  6. Page 4 · Availability - which channel may drop, and the failure that has no alert.
  7. Page 5 · How it works, told end to end, then Page 6 · Deployment plan - the drain and the rejoin wave.
  8. The DATA MODEL at the bottom: five tables, where board_shapes.last_writer is how the tug of war gets measured.
  9. Finish on the deliberate weakness: an advisory drag claim sent on the one channel that promises nothing. Argue whether delta ops or a server-side lease is worth a round trip in front of the first pixel of a drag.

1 · Requirements

Ask these before drawing anything

  • How many people may be on one board? Six is a design; forty is a different design; four hundred is a broadcast product with a canvas attached, and presence has to become one aggregated frame rather than n of them.
  • Is a drag an intent or a position? "Move to (x, y)" is trivial to implement and loses an argument between two draggers. "Move by (dx, dy)" keeps both intents and drifts. There is no third option that is both.
  • May a shape be locked while somebody is manipulating it? A real lock needs a lease, a holder, and a rule for what happens when the holder’s laptop closes mid-drag. An advisory claim needs none of that and does not actually prevent anything.
  • Does the board need to be correct while nobody is looking at it? If yes, the in-memory room is a cache with a write-behind and needs a durability story. If no - and for a whiteboard it largely is no - the debounce can be generous.
  • How large may one board get? Canvases grow without bound because nothing is ever deleted, only moved off to the side. The p99 board is two orders of magnitude bigger than the median.
  • Must a late joiner see the board instantly? Sending the whole document is simple and is megabytes; sending a viewport-shaped subset is fast and means the client no longer holds a complete document, which breaks undo.
  • Is there an audit requirement - who moved this? That turns the op log from an optimisation into a retained record with its own lifetime.
  • What is the acceptable behaviour on reconnect after two minutes? Replay, or reload? Replay needs op retention; reload loses local unsent work.

Functional

  • Several people draw, move and edit shapes on one canvas and converge on the same board.
  • Every participant sees the others’ cursors, and their viewport rectangles when they are following somebody.
  • A drag is smooth locally at 60 fps regardless of network conditions.
  • A late joiner receives the current board and then follows along from that revision.
  • Undo is per person: undoing your own last action must not undo somebody else’s.
  • A board survives everybody leaving and is identical when reopened.

Non-functional

  • Local feedback: within one frame, 16 ms. A canvas that waits for a server to move a shape is unusable in a way a text editor is not - the pointer is already somewhere else.
  • Remote application: p50 under 150 ms, p99 under 500 ms in region. Above about 250 ms a remote cursor stops looking alive and starts looking broken.
  • Presence has no delivery guarantee whatsoever. Dropping frames under load is correct behaviour, not degradation.
  • 99.9% for opening and editing a board. Presence has no availability target.
  • Convergence is a correctness property: given the same ops, every client renders the same board. Position disagreement between two clients is a bug at any latency.

Out of scope

  • Real-time audio and video, which share the room concept and nothing else.
  • Vector export and printing, which read a snapshot rather than the live room.
  • Infinite-canvas spatial indexing for search, which is a separate board.

The rest of this board

Preview of the Whiteboard sync system design board: 16 components joined by 20 connections. The labelled board opens in Tierslate.
Board preview

Available on Tier Slate

This page publishes the question. The answer — 5 more written pages, a 9-step narrated walkthrough and a 5-table schema — is the board itself, and it opens in Tierslate.

  • 5written pages
  • 9walkthrough steps
  • 5tables38 columns

5 pages behind this one

  • Capacity estimation
  • Storage estimation
  • Availability
  • How it works
  • Deployment plan
Open this board in TierslateBrowse every board

Related system design templates

Several people editing one thing without losing an edit. 7 more collaboration templates:

  • Calendar scheduling system design - Why a meeting time is computed from rules and guesses rather than read from a table, and what that costs.
  • Code review system design - What it takes to keep a conversation attached to code that is rewritten underneath it while the conversation is still going.
  • Collaborative editor system design - How two people type into one document at the same time without either of them losing a character.
  • Version control system design - Why history is a graph rather than a list, and what that costs at merge, at fetch and at garbage collection.
  • Kanban board system design - How cards are reordered with fractional ranks instead of renumbering, and how live updates reach every viewer.
  • File sync system design - How files sync across devices by chunk and version, and what a conflict looks like when two laptops were offline.
  • Multiplayer game server system design - Why an authoritative server with client prediction hides latency, and how a tick rate sets cost and fairness.
Open the Whiteboard sync board in TierslateAll collaboration templatesAll 100 system design templates
Tierslate

tierslate.com

HomeTemplatesGuidesCompareAboutUI mockupsPrivacyTerms