DesignTheSystem/dev
MEDIUM Stateful & Collaboration

Design Real-Time Gaming Leaderboard

Design a real-time gaming leaderboard handling 40,000 score submissions and rank lookups/sec. Keep p99 response time under 25ms without overloading backend SQL.

Category & DifficultyStateful & Collaboration · MEDIUM
Traffic Profile40,000 RPS sustained, 56,000 RPS spike (75% reads / 25% writes)
Latency & Availability SLAp99 < 25 ms · 99.99% availability
Monthly Infra Budget$450/month

Scale, traffic & SLA targets

To pass in the DesignTheSystem simulator, your architecture must hold all four targets simultaneously across a 60-second load run (spiking up to 56,000 RPS):

Peak traffic40,000 RPS75% reads / 25% writes
Latency (p99)< 25 ms99th percentile target
Availability99.99%Max error rate 0.01%
Monthly budget$450/moPriced per component

Functional & non-functional requirements

Functional scope

  • Serve Design Real-Time Gaming Leaderboard at the traffic below.

Non-functional goals

  • p99 latency under 25 ms at the spike.
  • At least 99.99% of requests answered.
  • Costs no more than $450 a month.

Core challenge: Let a sorted set do the ranking

Ranking millions of scores with SQL on every view is slow. Redis sorted sets keep scores in order as they change, so 'top 10' and 'my rank' are instant.

What breaks first?

Run the starting design first and look at what breaks. Leaderboard DB reaches 784% of its capacity at the spike, and Score Service 101%. About 57% of requests fail. Open Full metrics to see which requests pile up there, and ask why that part gets so much traffic.

Key architectural trade-offs

  • Shared state in memory needs a backup plan: replicate it, or be able to rebuild it from durable storage after a failure.

Starting architecture & how to practise

The simulator starts you with a baseline setup: Mobile Game Clients → Score Service → Leaderboard DB. Run the baseline under 40,000 RPS to watch exactly which component saturates first, then add caching, queues, replicas, sharding or CDN until latency, availability and cost all turn green.

Common interview questions for Design Real-Time Gaming Leaderboard

What are the target SLA and scale numbers for Design Real-Time Gaming Leaderboard?

Design for 40,000 RPS sustained (spiking to 56,000 RPS) with a 75% read / 25% write mix, keeping p99 latency under 25 ms, availability at or above 99.99%, and infrastructure spend within $450/month.

What is the main architectural bottleneck in Design Real-Time Gaming Leaderboard?

Ranking millions of scores with SQL on every view is slow. Redis sorted sets keep scores in order as they change, so 'top 10' and 'my rank' are instant.

How can I verify my Design Real-Time Gaming Leaderboard architecture works under load?

Open the live simulator to wire up load balancers, caches, queues, replicas, or shards and run a 60-second traffic simulation that grades latency, error rate, and monthly cost automatically.

Recommended lessons before you build

Related Stateful & Collaboration problems