Real-time Fan-out & Push
Delivering one event to thousands or millions of connected clients.
Distributed SystemsIntermediate7 hrs4 key ideas · 7 applied designs
0%
your progressOverview
Delivering one event to thousands or millions of connected clients.
Key ideas
- Fan-out on write precomputes feeds (fast reads); fan-out on read builds them on demand (cheap writes).
- Hybrid: push for normal users, pull for celebrities with millions of followers.
- Persistent connections (WebSockets, SSE) need a connection registry to route messages to the right gateway.
- Presence is a soft-state problem: heartbeats and TTLs, not durable writes.
Trade-offs
- Push-everything melts down on celebrity accounts.
- Long-lived connections make deploys and load balancing harder.
In the real world
Twitter timelinesWhatsApp / Discord gatewaysFirebase Cloud Messaging
Keywords
WebSocketsPub/SubPresence