TinyURL Analytics System Design (Click Streams & Aggregates at Scale)

Design a URL shortener like TinyURL that not only shortens URLs but also provides detailed analytics on link clicks, including geographic location, device type, referrer, and time-based statistics.

Constraints

Functional

Shorten URL, redirect to original, track every click, analytics (total, over time, geography, devices), custom aliases, expiration

Non-functional

Redirect < 100ms, 99.9% uptime, millions of URLs and billions of clicks, accurate tracking

Scale

1B URLs, 10B clicks/month, peak ~5K/s; ~500 GB URL data; ~200 B/click → 2 TB/month raw (or ~100 GB/month aggregated)

Stages ahead

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