
π Sports & Fitness Β· Data Flow
How live scores reach millions of fans within a second: official scorers, the data feed, stream processing, caching and push notifications.
Drawing diagramβ¦
Data flow for live cricket/football scores: the official scorer app and a third-party data feed send ball-by-ball events to an ingestion API, events go through Kafka to a stream processor that validates them and updates the match state in Redis, a WebSocket fan-out service pushes updates to fans' apps, key moments trigger push notifications through FCM/APNs, and all events are archived to a database for stats.
flowchart LR SC[Official Scorer App] -->|Ball-by-ball events| ING[Ingestion API] FEED[Data Provider Feed] -->|Match events| ING ING -->|Events| K[Kafka] K --> SP[Stream Processor] SP -->|Match state| R[(Redis Cache)] R -->|Score updates| WS[WebSocket Fan-out] WS -->|Live score| APPS[Fan Apps and Web] SP -->|Wicket / goal| PN[Push Notifications - FCM / APNs] PN --> APPS SP -->|All events| DB[(Stats Database)]
Where each part of a fitness tracking product runs: the wearable, the phone app that syncs it, and the cloud services for workouts, goals and coaching.
A platform to run an amateur or professional league: team registration, fixtures, match scoring, standings and fan apps.
How a fan books tickets for a big match: queue, seat selection with a temporary hold, payment and a mobile ticket with QR code.
A timeline for organising a multi-team tournament: registrations, league stage, knockouts, final and the work around it.
A schema for a sports league: teams, players, squads per season, matches, match events and player statistics.
The states of a gym membership: trial, active, frozen, expiring, renewed, lapsed and cancelled.