URL Shortener System Design (like Bitly)

Architecture of a URL shortener like Bitly: short code generation, fast redirects through a cache, a key-value database and click analytics. One of the most common system design interview questions.

URL Shortener System Design (like Bitly) — System design

How it flows

  1. Browser / App → API Gateway (HTTPS)
  2. Mobile Client → API Gateway (HTTPS)
  3. API Gateway → Short Code Service (REST)
  4. API Gateway → Redirect Service (REST)
  5. Short Code Service → Key Generation Service (gRPC)
  6. Key Generation Service → Key Store (Read/Write)
  7. Short Code Service → URL Database (SQL)
  8. Redirect Service → Cache (Cache Lookup)
  9. Cache → URL Database (Cache Miss → SQL)
  10. Redirect Service → Event Stream (Click Event)
  11. Event Stream → Analytics Service (Stream)

Components

Browser / App · Mobile Client · API Gateway · Redirect Service · Short Code Service · Key Generation Service · Cache · URL Database · Key Store · Event Stream · Analytics Service

← All designs

Try AI Flowchart free →