Functional
- Shorten a long URL to a unique 7-character code
- Redirect short URLs to the original with < 100ms p99 latency
- Track click counts per short URL (eventually consistent is fine)
- Support optional custom vanity codes
Non-functional
- Sustain 5,000 redirects/sec steady state
- Survive a 3x traffic spike (viral link) without dropping requests
- Survive a region-A database outage with < 1% error rate
- Total infrastructure cost under $3,500/month
Failure scenarios
- ⚡ Launch day steady state
- ⚡ A link goes viral (3x traffic)
- ⚡ Region A database outage
Approach guide
- 1.Phase 1 — Scope & Estimate10m
- 2.Phase 2 — The Redirect Path (Hot Path)15m
- 3.Phase 3 — The Write Path & Code Generation10m
- 4.Phase 4 — Availability: Region-A DB Outage15m
- 5.Phase 5 — Operations & Cost10m
Full guide on the brief page.
Key numbers
- Redirects per day432M/day
- Write volume (new URLs)4.3M/day
- Code space (7-char base62)3.5 trillion unique codes
- Storage per URL record~200 bytes
- Storage at 100M URLs~20GB