Skip to main content

Module 1: System Design Methodology: Worked Examples

Example 1: Estimate Before Drawing

Problem. Design a photo-sharing feed for 10 million daily users. “Use a CDN and cache” is not yet a design.

Assume 20 sessions/user/day, 20 feed items/session, 5% of users upload two 3 MB photos/day, and a 3x peak factor. Feed reads average about 2,315 sessions/s and peak near 7,000/s. Upload payload is about 3 TB/day before replication and derived images. These estimates identify media delivery, metadata fan-out, storage growth, and hot creators as the first deep dives.

Wrong attempt. Produce precise capacity numbers from unstated assumptions. False precision hides uncertainty.

Correct reasoning. State assumptions, calculate orders of magnitude, identify the decision each estimate affects, and sensitivity-test the two assumptions most likely to change the architecture.

Example 2: Define the Contract Before Components

For GET /feed?cursor=..., define identity, stable ordering, cursor semantics, freshness expectation, visibility filtering, maximum page size, and behavior when followed accounts are deleted. Only then choose fan-out-on-write, fan-out-on-read, or a hybrid.

Example 3: Stress-Test a Design

Walk normal request, dependency timeout, cache stampede, regional loss, poison event, and celebrity hot key. For each, name detection signal, bounded behavior, recovery, and data-correctness consequence. A diagram without failure behavior is incomplete.

Completion Standard

  • Produce an assumption table and sensitivity analysis.
  • Trace two core requests end to end.
  • Defend the design against at least five failure or scale changes.