URL Shortener Design
Design a read-heavy URL shortener end to end, combining ID generation, key-value storage, caching and off-path analytics.
3 objectives 5 steps about 100 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Estimate read/write ratio, storage and cache size for a shortener with stated traffic.
- Design code generation, redirect semantics (301 versus 302) and a key-value data model with expiry and custom aliases.
- Scale the redirect path with caching and replicas, and move click analytics and abuse checks off the critical path.
Lesson plan
5 steps, about 100 min · 4 of 4 lessons available so far
- Scoping and estimating a link shortener Worked example · 20 min
- Code generation and the data model Worked example · 25 min
- A redirect path that serves 100k reads per second Worked example · 25 min
- Abuse, expiry and analytics without slowing redirects Concept · 15 min
- Shortener design check Knowledge check · 6 questions
Practise it
Write a 2-3 page design doc for a shortener with 100M new links per month and a 100:1 read ratio, covering estimates, API, schema, code-generation choice, cache plan and the failure mode of each component.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own URL ShortenerIntro · 4–8 h
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.