← Lessons

quiz vs the machine

Gold1380

System Design

The Awareness Protocol

Gossiping volatile per user state so the room knows who is doing what.

5 min read · core · beat Gold to climb

What awareness covers

An awareness protocol synchronizes the small volatile facts about each participant: cursor, selection, name, color, and whether they are typing. Unlike document edits, awareness is not persisted and does not need ordering guarantees, only freshness.

How it spreads

Each client owns a small awareness state object and broadcasts it whenever it changes. Other clients keep a map from client id to that state. A higher clock counter on each update lets receivers ignore stale messages that arrive late.

Cleaning up

Because users disconnect abruptly, awareness entries carry a timeout. If no update arrives within the window the entry is dropped, removing the ghost cursor.

Keeping awareness on a lightweight channel means a storm of cursor moves never competes with durable document updates.

Key idea

An awareness protocol gossips volatile per user state with counters and timeouts so the room stays fresh without persistence.

Check yourself

Answer to earn rating on the learn ladder.

1. How does a receiver reject stale awareness updates?

2. Why do awareness entries carry a timeout?