Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 22

Design top charts for an app store

Intermediate · 35 min · Search & ranking

An app store shows "Top Free", "Top Paid" and "Top Grossing" charts for every category in every country. Developers watch their rank closely because a spot in the top 10 brings a lot of new installs, which also makes the charts a target for people who buy fake installs.

Requirements

  • Publish the top 200 apps for each chart type, category and country, plus an all-categories chart.
  • Rank apps by recent demand (installs for free charts, purchases or revenue for paid and grossing), with recent days weighing more.
  • Keep installs judged fraudulent out of the rankings, including when the verdict arrives late.
  • Show an app's current rank on its page, and keep a daily history of ranks.

Constraints and assumptions

  • 3 million apps, 60 categories, 150 countries, 3 chart types: about 27,000 charts.
  • 500 million install and purchase events per day, peaking at 20,000 per second.
  • Charts are recomputed once an hour; a published set of charts must switch over all at once.
  • Chart pages are read 50,000 times per second at peak.
  • Fraud verdicts can arrive up to 48 hours after the install.

Out of scope for the first sketch

Personalized recommendations · Search ranking · The fraud detection models themselves

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches