bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/System Design/Design a URL Shortener
System Design•Design a URL Shortener

Design a URL Shortener: High-Level Architecture

Design a service that turns long URLs into short links, redirects on access, and reports click counts.

How to approach it

Sketch the request path from the client inward: client → edge/CDN → load balancer → stateless services → cache → database, with queues and workers off to the side for async work. Keep services stateless so they scale horizontally. Draw the happy path first; resilience and scale come after.

Components

ComponentRole
Clientbrowser / app
CDN / Edgecache hot redirects
Load BalancerL7 routing
Link Servicestateless create + redirect
Rediscode→url cache-aside
Key-Value DBdurable mapping, sharded by code
Queueclick events
Analytics Workerroll up counts

Request path

Client → CDN / Edge → Load Balancer → Link Service → Redis → Key-Value DB

Previous

Design a URL Shortener: API & Data Model

Next

Design a URL Shortener: Scaling

This chapter

Overview
7

Lessons

14m

Read time

1. Design a URL Shortener: Requirements & Scope2. Design a URL Shortener: Capacity Estimation3. Design a URL Shortener: API & Data Model4. Design a URL Shortener: High-Level Architecture5. Design a URL Shortener: Scaling6. Design a URL Shortener: Deep Dive7. Design a URL Shortener: Tradeoffs & Review

On this page

How to approach itComponentsRequest path