aws
System Design
beginner
Short link creation and redirect tracking

URL Shortener System

System Design Classic

A URL shortener converts long URLs into compact aliases and redirects users at high speed. This AWS-native design serves redirects from CloudFront edge caches for sub-millisecond latency, stores URL mappings in DynamoDB with single-digit millisecond reads, and uses ElastiCache to absorb hot-link traffic. Kinesis captures click events for real-time analytics. A practical starting point for engineers learning system design fundamentals around hashing, caching, and redirect strategies.

Data Flow

Edge Redirect
Shortener API
Click Events
URL Resolver
URL Creator
URL Mappings
Redirect Cache

Share this architecture with your network

Service Breakdown (7 services)

Compute2 services
URL Resolver
  • Executes serverless functions on demand
  • Scales automatically with zero idle cost
  • Ideal for event-driven and async workflows
URL Creator
  • Executes serverless functions on demand
  • Scales automatically with zero idle cost
  • Ideal for event-driven and async workflows
Networking2 services
Edge Redirect
  • Caches and delivers content at the edge globally
  • Reduces latency with geographically distributed PoPs
  • Handles SSL termination for all inbound traffic
Shortener API
  • Routes and throttles incoming API requests
  • Enforces authentication and rate limiting
  • Provides a unified entry point for microservices
Messaging1 service
Click Events
  • Ingests real-time streaming data at scale
  • Supports multiple consumers per stream
  • Buffers events for downstream processing
Data2 services
URL Mappings
  • Provides single-digit millisecond reads and writes
  • Scales throughput automatically with demand
  • Supports global tables for multi-region access
Redirect Cache
  • Caches hot data in-memory for sub-ms latency
  • Supports Redis and Memcached engines
  • Reduces database load with intelligent caching

Scaling Strategy

CloudFront caches redirect responses at the edge, so the most popular short links never hit the origin. ElastiCache holds the hottest URL mappings in memory for Lambda resolvers, and DynamoDB auto-scales throughput for write bursts during link creation campaigns. Kinesis buffers click events asynchronously so analytics ingestion never slows down redirect latency.

Related Architectures