Live scoring architecture at million-viewer concurrency is a specific engineering discipline. This guide is for engineering leads and architects building score feeds, fantasy contests or match centres for cricket and football, and it walks through the architecture that holds up under real load: how events come in, how state is computed, how updates reach viewers, and what to watch while a match is live.
Key takeaways for live scoring at scale
Event-sourced backend: every match event is an immutable record.
Fan-out via push (WebSockets or SSE) for active viewers; pull (HTTP) for passive.
Leaderboards via Redis sorted sets, eventually consistent.
Edge caching for less time-sensitive views.
Observability is non-negotiable.
The live scoring architecture, layer by layer
Each layer has one job, and the boundaries between them are what let the system scale piece by piece.
Layer | What it does | Typical tools |
|---|---|---|
Event ingestion | Takes in the data feed as immutable, timestamped, ordered events | Kafka |
Processing | Computes scores, rankings and fantasy contest standings | Consumers writing to Redis or DynamoDB |
Fan-out | Pushes new events to active viewers; passive viewers pull | WebSocket, SSE, HTTP |
Leaderboards | Ranks millions of users with sub-millisecond queries | Redis sorted sets |
Edge | Serves static or slow-changing views | CDN |
Event ingestion
Data feeds (cricket: ball-by-ball; football: play-by-play) ingest into a Kafka topic. Each event is immutable, timestamped and ordered. Because nothing is ever overwritten, any derived state can be rebuilt by replaying the topic, which is what makes the rest of the design recoverable.
Processing
Event consumers compute derived state: scores, rankings, fantasy contest standings. They write to a fast store (Redis, DynamoDB) so that reads never touch the event log directly.
Fan-out to viewers
Active viewers (users with the app open) connect via WebSocket or SSE, and new events push to the relevant viewers. Inactive viewers (app in the background) pull via standard HTTP when the app comes to the foreground.
Leaderboards
Redis sorted sets handle million-user leaderboards with sub-millisecond rank queries. A sorted set keeps members ordered by score, so updating a user's points and reading their rank are both single commands:
# add or update a user's points in a contest leaderboard
redis-cli ZADD contest:42:board 1280 user:9001
# the user's rank (0-based, highest score first)
redis-cli ZREVRANK contest:42:board user:9001
# the top 10 with their scores
redis-cli ZREVRANGE contest:42:board 0 9 WITHSCORES
These rankings are eventually consistent: a rank that settles a moment after the event is fine for viewers. If you are building contests on top of this, our fantasy sports platform primer covers the regulatory side.
Edge
Static or slow-changing views (player info, match metadata) are cached at the CDN edge, which keeps that traffic off the origin entirely.
Scale patterns for million-viewer concurrency
Pattern | How it works |
|---|---|
Sharding | Partition users by contest, by region, by user ID. Each shard has bounded work. |
Read replicas | The primary handles writes (event ingestion and state updates). Replicas serve reads. |
Async everything non-critical | Notifications, secondary updates and analytics all run async. |
Pre-warming | For known peak times (an IPL final), pre-scale 30 minutes ahead. |
What goes wrong under live load
Hot rows
The top-scoring player's row gets hammered as every viewer and every fantasy team reads it. Cache it.
Cascading failures
One slow service slows everything that waits on it. Put circuit breakers between services so a struggling dependency fails fast instead of dragging the rest down.
WebSocket scale
WebSockets are expensive at million-scale. Use them only for the most engaged users, and HTTP polling for the rest.
Data feed gaps
Sometimes the provider misses an event. Have replay capability, which the event-sourced log gives you almost for free.
Observability during live events
Build dashboards for:
Event ingestion lag
WebSocket connections per shard
Leaderboard query latency
Cache hit rates
Error rates by API
And run a war room during live events, with those dashboards on screen and owners for each layer in the room.
Common pitfalls and how to avoid them
Pitfall | What to do instead |
|---|---|
Trying to make everything real-time | Let some data lag 5-10 seconds; users don't notice. |
Single point of failure | Run multi-region active-active for major events. |
Database for hot leaderboards | Use Redis. |
No load test at expected peak | Test at 2x peak before going live. |
Some data can lag 5-10 seconds; users don't notice. Spend your real-time budget where it counts.
What we recommend
Event-sourced foundation. Redis for hot reads. WebSockets only where needed. Multi-region. Load-test obsessively. Live scores usually sit beside the match video itself, and our guide to OTT sports broadcast infrastructure covers that half of the stack. Ticket drops for the same fixtures bring their own spike, covered in ticketing platforms that survive flash sales.
FAQs
Does edge caching work for live scoring?
For some data, yes (player metadata). For core scoring data, not really.
Do we need a polling fallback?
Always. WebSockets fail.
How important is mobile?
Critical: most viewers are on mobile.
Building for a big match day? Talk to Techpuvi about live scoring infrastructure, or see how our cloud and DevOps practice runs platforms built for peak load.
