Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

100M-Player Real-Time
Leaderboard Architecture.

Design a global gaming leaderboard sustaining 200k score updates/sec with <15 ms Top-100 and rank queries.
Start the journey7 stages· Last modified Nov 24, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When a single bottleneck threatens end-to-end availability, combine K-sharded ZSETs, 500 ms Top-100 caching, and score-bucket prefix sums.

TL;DR30-second simplified summary
▾

SQL ORDER BY and single-node Redis collapse under 200k/sec score mutations. Sharding ZSETs by userId with async Kafka persistence and score-range histograms scales linearly.

Full walkthrough · 7 stages
01
foundation

Stage 1: Capacity & QPS Math.

Why this matters: Establish capacity & qps math for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 1: Capacity & QPS Math as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish capacity & qps math for 100M-Player Real-Time Leaderboard Architecture.

Stage 1: Capacity & QPS Math establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

Request & State Flow

Stage 1: Capacity & QPS Math

ClientLeader / CoordReplica AReplica B1. Propose write with fencingtoken2. AppendEntries(term, index)3. Await majority quorum ack4. Commit & apply to state machine
02
foundation

Stage 2: Single-Node Bottleneck.

Why this matters: Establish single-node bottleneck for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 2: Single-Node Bottleneck as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish single-node bottleneck for 100M-Player Real-Time Leaderboard Architecture.

Stage 2: Single-Node Bottleneck establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

Lifecycle & Failure Recovery

Stage 2: Single-Node Bottleneck

election timeoutmajority voteshigher term seenFollowerCandidate ElectionElected LeaderMinority Isolated
Engineering Decision Framework
Problem
How to implement 100M-Player Real-Time Leaderboard Architecture without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
When a single bottleneck threatens end-to-end availability, combine K-sharded ZSETs, 500 ms Top-100 caching, and score-bucket prefix sums.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When 100M-Player Real-Time Leaderboard Architecture experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Stage 3: User-ID Sharded ZSETs.

Why this matters: Establish user-id sharded zsets for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 3: User-ID Sharded ZSETs as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish user-id sharded zsets for 100M-Player Real-Time Leaderboard Architecture.

Stage 3: User-ID Sharded ZSETs establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

04
intermediate

Stage 4: Top-K Min-Heap Merge.

Why this matters: Establish top-k min-heap merge for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 4: Top-K Min-Heap Merge as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish top-k min-heap merge for 100M-Player Real-Time Leaderboard Architecture.

Stage 4: Top-K Min-Heap Merge establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

05
intermediate

Stage 5: Score-Range Histograms.

Why this matters: Establish score-range histograms for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 5: Score-Range Histograms as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish score-range histograms for 100M-Player Real-Time Leaderboard Architecture.

Stage 5: Score-Range Histograms establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

Design Trade-Off

Stage 5: Score-Range Histograms

Before · Async Primary / Split-Brain
  • Stale leader overwrites state
  • Clock skew breaks lease order
  • Full-table sync on reboot
After · Quorum + Monotonic Fencing
  • Majority quorum prevents split-brain
  • Fencing tokens reject zombies
  • Merkle/WAL catch-up in O(log N)
06
advanced

Stage 6: Caching & Write-Behind.

Why this matters: Establish caching & write-behind for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 6: Caching & Write-Behind as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish caching & write-behind for 100M-Player Real-Time Leaderboard Architecture.

Stage 6: Caching & Write-Behind establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

Component Topology

Stage 6: Caching & Write-Behind

ClientingressQuorum LeadercomputeReplica 1storageReplica 2controlwrite(token)AppendEntriesquorum sync
07
advanced

Stage 7: Failover & Rebalancing.

Why this matters: Establish failover & rebalancing for 100M-Player Real-Time Leaderboard Architecture.

Think of Stage 7: Failover & Rebalancing as the intuition layer for 100M-Player Real-Time Leaderboard Architecture: Establish failover & rebalancing for 100M-Player Real-Time Leaderboard Architecture.

Stage 7: Failover & Rebalancing establishes how 100M-Player Real-Time Leaderboard Architecture behaves under real production load.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

How do you compute global Top-100 across K sharded ZSETs (Check 1)?

Recommended Learning Flow