Why the live score reaches your phone before the video (System Design Notes)

Why a WICKET notification beats your live stream by 20-30 seconds: events, polling vs persistent connections, pub/sub fan-out, push notifications, the thundering herd after a notification, and how to explain it in an interview.

By InternHack Team · · 6 min read · System Design

Last ball. Your phone buzzes: WICKET! On your stream, the bowler hasn't even started his run-up. Your neighbour's phone shouts "SIX!" before your video shows the shot. None of this is a glitch. The score and the video travel down two completely different roads.

These notes take the live score apart like a system design problem: why the video is late, what the score actually is, why "just ask every second" breaks at cricket scale, how a single ball reaches crores of phones, and what goes wrong right after the notification. At the end there's an answer you can give in an interview.

Two roads: why the video is 20-30 seconds behind

Live video is heavy. The broadcast is encoded, cut into segments a few seconds long, copied to CDN servers in every city, and your player keeps a few segments in its buffer so the picture doesn't freeze when the network dips (we covered this in Part 10). Apple's own guidance is that regular HLS live streams run 20-30 seconds behind live. Low-Latency HLS can bring that down to 1-2 seconds, but most big streams trade that latency for stability.

The score is the opposite: a tiny message. Something like { over: 19.6, type: "WICKET", score: "171/7" }. In system design we call that an event. It doesn't need segments, buffers or CDNs. It only needs to reach the phone fast.

Sign up free to unlock the full notes

Aage ke sections free InternHack account ke saath khulte hain:

  • Where the event comes from
  • Idea 1: polling, and why it breaks
  • Idea 2: a persistent connection
  • Pub/sub: one event, every connection server
  • When the app is closed: push notifications
  • The twist: the notification causes a stampede
  • You've seen this
  • Numbers worth remembering
  • Edge cases an interviewer may ask
  • How to answer this in an interview

Sign up free

Sources

  • RFC 8216, HTTP Live Streaming (start about three target durations from the live edge): https://www.rfc-editor.org/rfc/rfc8216
  • Apple WWDC19 "Introducing Low-Latency HLS" (regular HLS 20-30 s behind live; LL-HLS 1-2 s): https://wwdcnotes.com/documentation/wwdc19-502-introducing-lowlatency-hls/
  • Hotstar Tech Blog, "Building Pubsub for 50M concurrent socket connections": https://blog.hotstar.com/building-pubsub-for-50m-concurrent-socket-connections-5506e3c3dabf
  • System Design One, Hotstar architecture (Kafka -> PubSub fan-out, 250k connections per machine): https://newsletter.systemdesign.one/p/hotstar-architecture
  • ByteByteGo, how Disney+ Hotstar scaled (scorecard as a cached API, refresh reduced under load): https://blog.bytebytego.com/p/how-disney-hotstar-now-jiohotstar
  • The Next Web, Hotstar CEO on 3-4 million fans within milliseconds of a notification: https://thenextweb.com/news/how-hotstar-streams-cricket-matches-to-10-million-passionate-fans-at-once
  • Hotstar Tech Blog, "Scaling Is Not An Accident" (panic switches, retry storms): https://blog.hotstar.com/scaling-is-not-an-accident-895140ac84c0
  • WhatsApp blog, "1 million is so 2011": https://blog.whatsapp.com/196/1-million-is-so-2011
  • Firebase Cloud Messaging throttling and quotas: https://firebase.google.com/docs/cloud-messaging/throttling-and-quotas
  • AWS Architecture Blog, "Exponential Backoff and Jitter": https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
  • How scoring in cricket takes place (BCCI scorers and their app): https://sportskeeda.com/cricket/how-scoring-in-cricket-takes-place
  • The Pragmatic Engineer, live streaming at world-record scale (IPL, 5.5 crore context): https://newsletter.pragmaticengineer.com/p/live-streaming-at-world-record-scale