Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
System Design, Redis & Distributed Systems 5-8 Years (Senior) Hard Production Scenario

How do you design a Global URL Shortener (Bitly-scale) handling 100M URLs and 10 Billion clicks/month?

Real-World Scenario / Incident Description

Interview system design question: Design a short link redirection engine with sub-10ms response times globally.

180 views • Updated 1 month ago

Key Architecture Decisions

  1. Base62 Encoding: [a-z, A-Z, 0-9]. A 7-character string allows $62^7 \approx 3.5 \text{ trillion}$ unique URLs.
  2. Distributed ID Generator (Snowflake / Redis Atomic Counters): Generate unique 64-bit auto-incrementing integer -> Convert to Base62.
  3. Caching & CDN:
    • Return HTTP 302 (Temporary Redirect) if click tracking analytics are required on every hit.
    • Return HTTP 301 (Permanent Redirect) if latency is prioritized (browser caches redirect permanently).
    • Cache hot 20% of URLs in Redis cluster (80/20 Pareto principle).
Related Concepts: #System Design #Base62 #URL Shortener #Distributed ID