URL Shortener: Requirements
What are we building.
Our first case study is a URL shortener, like bit dot ly. You give it a long web address, and it gives you a short one. Anyone who opens the short link is sent to the long address. It's a classic, because it's small, but touches many ideas.

- Long link in
- Short link out
- A classic first design
Requirements
Let's agree on requirements, step one of our framework. Functionally, users create a short link from a long URL. Opening the short link redirects to the long one. Links can optionally expire. Non functionally, redirects must be very fast, the service must be highly available, and short codes must not be guessable in order.
Functional
- Create a short linkRedirect to the long URLOptional expiry
Non-functional
- Redirects very fastHighly availableCodes not sequential
Questions worth asking
In an interview, ask before assuming. How many new links per day? How long are links kept? Can users choose a custom code? Do we need click statistics? Here, let's say a hundred million new links a month, kept for five years, with custom codes as a bonus feature.
| key | value |
|---|---|
| New links | 100 million a month |
| Kept for | 5 years |
| Custom codes | nice to have |
| Click stats | later |
Summary
AURL shortener creates short links and redirects them quickly and reliably. We've agreed on a hundred million new links a month. Next, step two. Estimates.
Key takeaways- Create and redirect
- Fast and available
- 100M links a month