Sikau

System design · Day 1 · about 30 min

Back-of-the-envelope numbers

Turn users and actions into requests per second and storage.

How big is big?

A design that serves 100 users and one that serves 100 million look completely different. Before drawing boxes, system designers do quick arithmetic: how many requests per second (QPS), how much data per year, how much at the busiest hour. The answers decide whether one server is plenty or you need a fleet.

A tea stall owner knows roughly how many cups sell at the morning rush — that number decides how many kettles to keep boiling, long before anyone pours.

The useful numbers

  • A day has 86,400 seconds — call it ~100,000 for mental maths.
  • 1 million requests a day ≈ 12 per second on average.
  • Peaks are often 2–10× the average.
  • 1 KB × 1 million = 1 GB.
function estimate({ dailyUsers, actionsPerUser, peakFactor = 2, bytesPerAction, days = 365 }) {
  const perDay = dailyUsers * actionsPerUser;
  const avgQps = perDay / 86400; // seconds in a day
  return {
    avgQps: Math.round(avgQps),
    peakQps: Math.round(avgQps * peakFactor), // traffic isn't flat: plan for the peak
    storageGB: Math.round((perDay * bytesPerAction * days) / 1e9),
  };
}

The rest of this lesson

  • A worked estimateexplain
  • Latency numbers to rememberexplain
  • A million userspredict
  • Quick conversionsmatch
  • Estimate itwrite code
  • Badge quizquiz
  • What you learnedrecap

Continue this lesson free — run real code in your browser

Continue with Google

See all 8 lessons of System design