Part VI โ The Blueprint ยท Lesson 11.7
HLD โ Live Commentary (CricInfo, Cricbuzz)
In one lineOne event fans out to millions of read-only clients โ the design problem is broadcast, not interaction.
Where you've seen itA wicket in a World Cup final. Nobody is sending anything; everybody is receiving the same thing at once.
Diagram
1โ2 ยท SCOPE AND SCALE
in scope live score ยท ball-by-ball commentary ยท scorecard
out chat ยท betting ยท video ยท fantasy leagues
scale 10M concurrent at peak ยท 1 event every ~30s normally,
bursts around wickets ยท traffic 50ร baseline in minutes
READ-ONLY: clients never write3 ยท FAN-OUT โ one event, ten million deliveries
โโโโโโโโโโโโโโโโ
โ scoring feed โ 1 event
โโโโโโโโฌโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโ
โ pub/sub โ
โโโโโโโโฌโโโโโโโโ
โโโโโโโโโโโโผโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ edge PoPโโ edge PoPโโ edge PoPโ SSE connections held here
โโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโ
~3M ~3M ~4M clients
SSE (2.5), not WebSocket: clients only receive, and SSE gives
auto-reconnect and Last-Event-ID replay for free.6a ยท DEEP DIVE โ TRANSPORT CHOICE AND FALLBACK
primary SSE one-way ยท plain HTTP ยท free reconnect
fallback short poll for proxies that block streaming (2.2)
10s interval + ETag โ cheap 304s
degrade under extreme load:
normal push every event
spike coalesce: one update per 2s carrying the latest state
extreme fall back to polling a CDN-cached score.json (TTL 5s)
โ survives ANY load, because it's just a cached file6b ยท DEEP DIVE โ THE SPIKE PROFILE
concurrent viewers
โฒ
10Mโ โญโโโฎ wicket / last over
โ โ โ
5Mโ โญโโโโโโโโโโฏ โฐโโโโโโโฎ
โ โญโโโโโโฏ โฐโโโโ
1Mโโโโโฏ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโบ time
pre-match innings finish
Design for the peak, and make the degraded mode automatic โ
a CDN-cached JSON poll is the floor you can always fall back to.How it works
- SSE per client, terminated at edge PoPs so no single origin holds ten million connections.
- Send deltas, not the whole scorecard โ a ball event is tiny; the full state is not.
- Include a monotonic event id so reconnects resume via
Last-Event-IDwith no gap (2.5). - Coalesce under load: batch to one update every second or two; nobody perceives the difference.
- CDN-cached JSON with a short TTL as the guaranteed fallback โ it scales infinitely because it's a static file.
Trade-offs
| Choice | Cost |
|---|---|
| SSE | No clientโserver channel (not needed here) |
| WebSocket | Duplex you don't use, harder scaling |
| CDN-cached polling | Up to TTL seconds stale; infinitely scalable |
| Delta events | Client must hold and patch state correctly |
Interview angle
"Ten million concurrent viewers. WebSocket or SSE?"
- SSE: the traffic is entirely one-way, and reconnect plus replay come free, which is the expensive part of a WebSocket build.
- Terminate connections at edge PoPs fanning out from pub/sub, so the origin publishes once.
- Then name the degradation ladder: full push โ coalesced push โ CDN-cached JSON polling, so peak load has a floor.
Recap
- Read-only fan-out means SSE, not WebSocket.
- Send deltas with event ids; reconnect resumes automatically.
- Always have a CDN-cached polling fallback โ it's the only mode that can't be overwhelmed.