SystemDesignDraw Logo
SystemDesignDraw

Architecture Whiteboard & Math

Real-Time & CollabAdvanced Difficulty9 min read

Design a Real-Time Collaborative Canvas & Design Tool (Figma / Google Docs)

A real-time multiplayer document engine uses stateful sticky session routing and server-authoritative operational ordering to sync 2D scene graphs across worldwide collaborators without locking.

Estimated Traffic3,000,000 WebSockets • 50,000 Mutations/sec
5-Year Data Footprint120 Terabytes
Target Latency< 15 milliseconds
Availability Target99.99% (4 Nines)
Need custom numbers for your interview?Calculate QPS & capacity in System Design Cheat Sheet →

Live Architecture Studio

Edit components, modify labels, add databases, or redraw connections directly on this canvas:

Browse Component Stencils & Icons →
Blueprint:Figma Multiplayer Engine
ZenResetExportFull

Loading Figma Multiplayer Engine Blueprint...

Mounting vector diagram elements, nodes, and capacity metrics

Mounting Figma Multiplayer Engine...
Loading
Topology Nodes (8) Interactive Canvas
⚡ Interactive Architecture Diagram • Drag & Drop Enabled

1. Problem & Challenge

When 20 designers simultaneously resize frames, type copy, and rearrange vectors, network delays and concurrent edits create divergence and cycles. The engine must guarantee instant 0ms local responsiveness and deterministic convergence.

2. Core Building Blocks & Responsibilities

👉 Desliza la tabla para ver roles y responsabilidades
ComponentRolePlain-English Explanation
WebAssembly Client EngineOptimistic RendererRuns C++/Rust in browser Wasm to apply local edits instantly at 60 FPS, buffering unconfirmed mutations until server ACK.
Sticky Session Envoy ProxyDocument Affinity RouterHashes document_id so all collaborators on the same file connect over WebSocket to the exact same multiplayer server process.
Authoritative Sequencer (Rust)Conflict ArbiterAssigns monotonic sequence numbers to operations, resolving property conflicts via Last-Writer-Wins and checking for tree cycles.
Ephemeral Presence BusCursor & Selection StreamBroadcasts 30Hz mouse cursor positions directly in-memory, bypassing persistent storage to prevent database bloat.
WAL & S3 Snapshot ServiceDurability EngineAppends operations to a Write-Ahead Log in DynamoDB, debouncing background snapshot uploads to Amazon S3 every 30 seconds.

3. Step-by-Step Request Flow

1

User Modifies Element

Client moves a shape: changes apply locally at 0ms latency in Wasm client memory.

2

WebSocket Delta Push

Operation delta is transmitted over WebSocket to the document-specific authoritative server.

3

Server Assigns Sequence Number

Rust server process verifies tree hierarchy (checks no cycles), stamps monotonic seq_id, and confirms to sender.

4

Broadcast to Collaborators

Confirmed delta is fanned out to all connected peers in the session to update their canvas trees.

4. Architectural Trade-offs

Decision:

Server-Authoritative LWW Tree vs Pure CRDT

Chosen: Server-Authoritative LWW Tree

Rationale: Pure CRDTs (like Yjs) maintain causality metadata and deletion tombstones that cause 3x to 10x memory bloat in massive 50MB canvas files. A central sequencer eliminates tombstone bloat while guaranteeing convergence.

Decision:

Sticky Stateful Servers vs Stateless Mesh

Chosen: Sticky Stateful Routing

Rationale: Stateless servers require cross-server distributed locks to order mutations. Pinning a document to a single server process allows lock-free single-threaded in-memory sequencing.

Interview Tip

Explain the Tree Cycle Anomaly: If User A moves Frame 1 inside Frame 2, while User B moves Frame 2 inside Frame 1, naive LWW creates an infinite cycle (1 contains 2 contains 1) causing both to disappear! The server must run an ancestor-cycle check before confirming reparent operations.

Distributed Architectures

Explore Related System Blueprints

View All Blueprints (13) →
Beginner Friendly6 min read

TinyURL Shortener

A URL shortener converts a long link (like a 100-character article URL) into a compact 7-character key (like tinyurl.com/xyz123) and redirects visitors in under 15 milliseconds.

Study Architecture →
Interview Favorite7 min read

API Rate Limiter

A rate limiter acts as a digital bouncer at the door of your API, ensuring each client stays within their allowed request limits (e.g. 100 requests per minute) and blocking abusive traffic.

Study Architecture →
Streaming & Media9 min read

Video Streaming CDN

Streaming high-definition video to millions of smart TVs and mobile phones requires breaking large 10GB video files into tiny 5-second chunks, encoding each into 20 different resolutions, and caching them right inside local ISP networks.

Study Architecture →
Real-Time & Geo10 min read

Uber Dispatch Engine

A real-time geospatial dispatch system matches riders with the most optimal nearby drivers using 64-bit H3 hexagonal indexing and 2-second batch optimization, minimizing city-wide pickup ETA and driver idle time.

Study Architecture →
Fintech & Ledger11 min read

Stripe Payments Ledger

A resilient financial payments architecture guarantees strict consistency (CP system) using cryptographic idempotency reservation, double-entry balanced postings, and sharded balance locks.

Study Architecture →
Feed & Distributed8 min read

Twitter Timeline & Feed

A timeline generation system balances high write amplification against fast sub-50ms reads by pushing tweets to followers of regular accounts, while pulling and merging celebrity tweets on-demand.

Study Architecture →