3. Back-of-the-Envelope Estimation

Estimates help identify orders of magnitude and likely bottlenecks. State assumptions and round numbers instead of pretending estimates are exact.

Traffic formulas

  • Average requests per second = daily requests / 86,400.
  • Peak RPS = average RPS × peak-to-average multiplier.
  • Write RPS = total RPS × write fraction.
  • Read RPS = total RPS × read fraction.
  • Approximate concurrent requests = RPS × average request duration in seconds.

Storage formulas

  • Raw storage = records per day × average record size × retention days.
  • Replicated storage = raw storage × replication factor.
  • Total storage should also account for indexes, metadata, logs, and growth overhead.
  • Image/video storage = uploads per day × average object size × retention days.

Bandwidth formulas

  • Average bandwidth in bytes/second = RPS × average payload size in bytes.
  • Approximate bits/second = bytes/second × 8.
  • Outbound bandwidth may dominate when responses contain large media objects.

Example: 10 million daily active users Assume each user generates 20 requests per day.

  • Daily requests = 10,000,000 × 20 = 200,000,000.
  • Average RPS = 200,000,000 / 86,400 ≈ 2,315.
  • If peak traffic is 4× average, peak RPS ≈ 9,260.
  • If 80% are reads, peak read RPS ≈ 7,408 and write RPS ≈ 1,852.

Example: storage growth Assume 5 million new records per day, each averaging 1 KB, retained for 365 days.

  • Raw daily growth ≈ 5 GB using decimal units.
  • Annual raw data ≈ 1.825 TB.
  • With three copies, replicated data alone is approximately 5.475 TB, excluding indexes and overhead.

Useful relationship: Little's Law Average in-flight work = throughput × average time in the system. At 2,000 requests/second and 0.2 seconds average latency, expect approximately 400 requests in flight.

Interview checklist: specify units, distinguish average from peak, include growth and retention, estimate payload sizes, and identify which assumptions most affect the result.

Key Takeaways
  • Use powers of ten and explicit assumptions.
  • Estimate peak traffic, not only daily averages.
  • Include replication, indexes, retention, and growth in storage estimates.
  • Use Little's Law to estimate in-flight work.
  • Treat estimates as directional inputs to architecture decisions.