Skip to content
SD-1 · URL SHORTENER · INTERACTIVE

Break it.
Then fix it.

Crank up the traffic, watch what melts, and add the parts a real URL shortener needs. Every switch is a decision you would defend in an interview.

CHALLENGEServe 400K redirects/s with p99 under 50 ms and no errors.
StatusDOWNAt 40K requests per second
p99 latency37 msTarget under 50 ms
Errors80.2%Requests being dropped
Monthly cost$1,7206 app servers
UsersLIVE
40K clicks/s · 400 new links/s
traffic source
Load balancerOK
Autoscales app servers
spreading 40K/s
App servers × 6DUPES
Minting keys independently
40K / 60K ops/s
CacheOK
95% of reads hit
40K / 500K ops/s
DatabaseDOWN
Links + every click
2.0K reads · 40K writes/s
The database is drowning in click writes. Every redirect also writes a click row. Move clicks to a queue so redirects never wait on analytics.
100:1Reads to writesOptimise the redirect path above everything else.
7Characters per key62⁷ ≈ 3.5 trillion keys. We need 6 billion.
95%Cache hit rateA small set of links gets most clicks.
302Redirect codeTemporary, so every click passes through and can be counted.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.