Catalogue / canva-2024-realtime-mouse-pointers

Canva shipped live mouse pointers over WebSockets and one Redis PubSub node, then added a WebRTC mesh with relay and fallback

Canva. Real-time mouse pointers in the design editor.

Organisation
Canva
Evidence
Reported from production
Source
Real-time mouse pointers

Canva Engineering Blog, published 2024-08-15

Records

Decision#d1

Start with WebSockets and Redis as the message broker between stateless backend instances

Decision#d2

Run PubSub on a separate single-node Redis instead of the Redis cluster

Decision#d3

Move pointer updates to peer-to-peer WebRTC in a mesh, keeping WebSockets for signaling and fallback

Decision#d4

Make connection setup cheaper instead of changing least-loaded balancing of WebSocket connections

Decision#d5

Encode pointer messages as binary protobuf instead of JSON

Decision#d6

Batch Redis PubSub commands by turning off the client's auto flush and flushing on a timer

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.