Design a Live Sports Score Service
Understanding the Problem
⚽ What is a live score service? Apps like SofaScore, Cricbuzz, ESPN or FlashScore show live scores, match events (goals, cards, wickets), ball-by-ball commentary and statistics for thousands of matches at once. Users keep a match open to follow it, or get a push notification the moment their team scores. The data comes from official feeds, data companies and human scorers, and it has to reach users faster than the TV stream they might be watching.
Whether the interviewer says SofaScore (football and dozens of other sports), Cricbuzz (cricket, with ball-by-ball commentary) or "handle the World Cup final," it's the same problem: a small, steady trickle of writes and an enormous, spiky crowd of readers who all want the exact same data at the exact same moment. We'll design for football and cricket together, since their data shapes differ a little (football is sparse events; cricket is an event every delivery), and treat the World Cup final as the peak we must survive.
Functional Requirements
Score apps grow features endlessly: standings, player ratings, heatmaps, news. Narrow it down.
Core Requirements
- Users should be able to see live scores for all matches in progress, and open a match to see its events, statistics and commentary.
- Users watching a match should see updates in real time, without refreshing.
- Users should be able to follow teams and matches and get push notifications for key events (kick-off, goals, red cards, final score).
- Scores should be corrected when an event is reversed, such as a goal disallowed by VAR.
Below the line (out of scope)
- Video highlights and live streaming.
- Betting odds (see Design a Sports Betting Platform).
- Historical statistics, player databases and editorial news.
- Fantasy scoring, which consumes this feed (see Design a Fantasy Sports Platform).
Non-Functional Requirements
Ask about the biggest day of the year, because the system is sized for it, not for a normal Tuesday. For our design: on a normal weekend, 5 million concurrent users follow around 5,000 live matches. On the day of a World Cup final (or an India vs. Pakistan cricket match), 50 million concurrent users watch one match, and 100 million devices follow it for notifications.
Core Requirements
- An event should reach users watching the match within 2-3 seconds of entering our system, and push notifications within about 10 seconds for most followers.
- The system should handle 50M concurrent viewers of one match, with sudden surges of 5-10x when a goal is scored and everyone opens the app.
- Scores must be correct and consistent: events in order, no double-counted goals, and corrections applied everywhere.
- The service should be highly available on match days: a stale score for a few seconds is acceptable, an error page is not.
Below the line (out of scope)
- Getting data out of the stadium faster than our providers do. We consume feeds; we don't run them.
- Personalized feeds and recommendations.
The math shows where the effort goes. Writes are tiny: 5,000 live matches producing an event every 30 seconds on average is under 200 events per second, and even ball-by-ball cricket commentary adds only a little. Reads are huge. If 50M users poll every 5 seconds, that's 10 million requests per second, all asking for the same few kilobytes. If instead we push, one goal becomes 50 million messages that must go out within a couple of seconds.
The key observation: everyone watching a match wants the same bytes. This isn't a database problem; it's a broadcast problem. The write path can be simple and strongly ordered, and almost all of the design is about making one update cheap to copy 50 million times.