URL Shortener System Design (Collision-Free IDs & Scale)

Design a service like TinyURL or bit.ly that shortens long URLs into shorter, more manageable links.

Constraints

Functional

URL shortening, redirection, optional custom URLs, optional expiration, click analytics

Non-functional

High availability, low latency (< 100ms redirect), scalability to billions of URLs, durability, short URLs (6–8 chars)

Scale

Read/write ~100:1; 500M new URLs/month, 50B redirects/month; peak ~200 writes/s, ~20K reads/s; storage ~250 GB/month, ~15 TB over 5 years

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs