</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 8: Ten Thousand Boards at the Top of the Hour - Deep Dive: Tournaments — Pairing, Round Starts and Standings

Executive Summary: Each tournament is one director actor in its home region. It owns registrations, pairings and standings, persists to that region's Postgres, and learns results from game-ended, idempotently by game_id. Games never wait on it. An Arena pairs whoever is waiting every 2 s (~120 players, 60 games per wave) and scores win 2, draw 1, loss 0, with streaks and berserk on top. A Swiss pairs 1,000 games per round with a Dutch-system engine, and each round waits for its last board. The hard part is the start: 10,000 games in 5 s for one Arena, and 3,000 games/s across the top of the hour. We pre-scale 10 min ahead, create games in batches, and put the board in the start push. Standings go out every 2 s: the shared top 10 via Pub/Sub, each player's own row only when it changes.

You: "Section 7 solved one game. A tournament is ten thousand of them plus a scheduler. The games don't change; the load shape and the bookkeeping do."

Two Formats, Two Load Shapes

Arena Swiss
Running example Saturday Blitz Arena, 3+0, 90 min Weekend Blitz Swiss, 3+2, 9 rounds
Typical size up to 20,000 up to 2,000
Pairing trigger a wave every 2 s over whoever is waiting once per round, for everyone
Scoring 2 / 1 / 0, streaks double, berserk +1 1 / ½ / 0, bye 1 point
Waiting ~1 min between games the whole round, plus a 1-minute gap
Stragglers nobody waits for anybody round N+1 waits for round N's last game

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.