Skip to main content
PProfileMatch
← Path

System Design · Design a URL Shortener (Worked Example)

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Sketching the route on a napkin

Trick to keep in mind+3 XP

Compare reads to writes before choosing what to scale.

Once you have converted the traffic estimate to per-second rates, look at the ratio between reads and writes. If a service gets one new item for every hundred lookups, effort belongs where the traffic is: caching popular items and spreading reads over replicas. A few dozen writes a second is a small load that one primary handles comfortably.

Read it once, then a question tests whether the trick stuck.