How Miro Dominates Using Real-Time Collaborative Whiteboard Sync
Introduction: The Collaborative Infinite Canvas
Real-time collaborative editing is difficult, but real-time multi-user whiteboard synchronization is a monumental engineering challenge. Unlike text editors that operate on a linear character sequence, a collaborative whiteboard is a multi-dimensional, infinite coordinate space. Dozens or hundreds of users can simultaneously draw freehand lines, move shapes, connect objects with dynamic arrows, edit text blocks, and drag canvases, all while expecting zero latency and absolute document consistency.
To deliver a smooth user experience, Miro created a sophisticated sync engine that handles spatial data distribution, high-frequency cursor updates, and real-time conflict resolution. The application must guarantee that all clients converge to the exact same visual state, even when network delays cause updates to arrive out of order.
Conflict Resolution: Operational Transformation and CRDTs
To maintain consistency across geo-distributed clients, real-time engines generally rely on one of two paradigms: Operational Transformation (OT) or Conflict-Free Replicated Data Types (CRDTs). Miro utilizes a hybrid approach tailored for visual spatial documents. While traditional text nodes in shapes may utilize OT for character-by-character editing, canvas layout structures benefit from state-based CRDT models.
Every object on the canvas is treated as an independent entity with unique IDs and properties (such as position coordinates, scale, z-index, and styling). When a user modifies an object, the client generates a state mutation event.
Since objects are independent, modifications to separate shapes do not conflict, allowing CRDT algorithms to apply mutations concurrently. When two users modify the same object property at the exact same millisecond, the system resolves the conflict using deterministic rule-based logic (such as last-write-wins based on synchronized physical clocks), ensuring all clients render the same layout.
Spatial Partitioning and Viewport-Based Subscriptions
As board sizes grow to contain thousands of shapes, sending every update to every collaborator becomes highly inefficient. A client viewing one corner of a massive board does not need to process real-time vector coordinate changes occurring miles away. Miro resolves this through spatial sharding and viewport-based pub/sub routing:
- Bounding Box Filtering: The whiteboard space is divided into a quadtree index or spatial grid. The server maintains record of each client's current viewport coordinates (the bounding box of what they can see).
- Selective Subscription: The client only subscribes to real-time sync updates for objects located inside or immediately adjacent to their active viewport.
- Dynamic Level of Detail: Objects that are extremely far away are either completely ignored by the client-side renderer or loaded as simplified, low-resolution placeholders until the user pans closer.
This spatial partitioning minimizes the CPU and memory footprint on the client, preventing browser tabs from crashing under the weight of massive collaborative workspaces.
High-Frequency Cursor Sync and WebSocket Transport
Cursor tracking is essential for the feeling of co-presence. However, sending mouse coordinates at 60 frames per second for 100 users would flood the network with tiny packets, resulting in severe bottlenecking. Miro handles this by separating high-priority document mutations (like creating a shape) from low-priority presence data (like cursor movements).
Cursor coordinates are serialized using compact binary protocols and sent over WebSockets. The server acts as a low-overhead router, broadcasting cursor positions with aggressive compression and rate-limiting. Client applications receive these coordinates and apply interpolation algorithms, smoothing out network jitter to render fluid, lag-free cursor movements even if packet delivery is irregular.
Optimizing Real-Time Collaborative Canvases at the Edge with Bramsley
Developing high-performance collaborative canvases requires minimizing the physical distance between user actions and the synchronization server. Bramsley Digital Studio solves this by moving collaborative pub/sub routing, delta validation, and room management directly to our global edge worker network. By terminating client WebSockets at the nearest edge point-of-presence, Bramsley reduces connection latency to the absolute minimum.
Bramsley's edge nodes run lightweight synchronization engines that resolve conflicts and coordinate state changes in regional caches before syncing the consolidated updates back to primary databases. This ensures that users collaborating within the same office or city experience sub-10ms response times. Partner with Bramsley to build next-generation, high-performance collaborative applications that scale effortlessly across the globe.