Betting Exchange: The Last-Minute Goal
Hard · system design problem
A goal in the last minute: six times the punters for forty seconds, all on one market, with a 120 ms latency budget. Nothing boots in time, the ledger cannot grow, and a lost bet is a regulatory incident.
The final minutes of a cup final: a goal can come any second. Punters place and cash out bets through bet-api, which reads live odds from Redis (3 nodes, fails closed), calls risk-engine synchronously (which writes the bet to the CockroachDB ledger) and must answer within 120 ms at p99. At T+30s the goal: punters ×6 for forty seconds; 70% of odds reads are for the one market. Instances take a minute to boot. A bet must never be lost — it may be confirmed a few seconds later, never more than 30. The run is graded on the whole surge.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.