Skip to content
System Designer

Easy · Games

Leaderboards

Players send their score at the end of every match and open the top-100 table all day. Everyone looks at the same top 100, which makes that one answer extremely popular. A tournament final will make it much worse. Practise this easy system design problem for free with a Google or GitHub account.

The brief

Players send their score at the end of every match and open the top-100 table all day. Everyone looks at the same top 100, which makes that one answer extremely popular. A tournament final will make it much worse.

Think of a global high-score table.

Users, scale and requirements

Who uses it
8 million players a month
Audience in plain numbers
8,000,000 people per month
Normal peak
≈ 6,000 requests per second
Request mix
Read: 85%; Write: 15%
Speed for 99 of 100 requests
Read: ≈ 300 ms; Write: ≈ 300 ms
Successful requests
99.9%
Data safety
At most 1 minute of writes may be lost.
Monthly budget
≈ $20,000
Data at rest
≈ 0.1 TB
Where users are
North America: 50%; Europe: 30%; Asia Pacific: 20%
Home region
North America
Waiting deadlines
Read: 900 seconds; Write: 3,600 seconds

≈ marks an approximation, just as in the game. Waiting deadlines measure the age of queued work and are separate from interactive response time.

  • One score record is about 100 bytes (approx.).

Questions that shape the design

How fresh must the top 100 be?

Five seconds behind is fine. Nobody notices.

Does a player need to see their own new score and rank immediately?

Their own score should show within a second or two. Everyone else can wait a few seconds.

Can we lose a score?

Rarely and only for the last minute. A lost score is a very unhappy player.

The traffic day

Consumer traffic, busiest in the evening. The clock covers 00:00 to 24:00 in the home region. Events add pressure on top of that normal traffic.

  1. 20:00 · Hot key

    One item gets a huge share of traffic: a celebrity profile, one product, one merchant.

    Affected share: 50%. Duration: ≈ 3,600 seconds.

  2. 20:30 · Viral spike

    A post blows up. Traffic climbs to several times normal within minutes.

    Traffic reaches 5 times the scheduled load; rises over 600 seconds, holds for 3,600 seconds and eases over 3,600 seconds.

What a strong design has to handle

  • Half the players are asking for the exact same page. Do they each need a fresh answer?
  • A five second copy is slightly stale. Players accept that for a global table, and the saving is enormous.
  • The player's own rank skips the edge copy, so it stays fresh but costs the origin a lookup.

Make a prediction, run a full traffic day, then compare the result. The in-game editorial opens after a finished day and includes measured reference designs.

Concepts to practise

Related problems