AI Hints
Home›System Design Tutorial›Case Study: URL Shortener
System Design · Lesson 91 of 120

URL Shortener: Requirements

What are we building.

⏱ 2 min read▶ Video at 1:50:05🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

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.

URL Shortener: Requirements
From the video: URL Shortener: Requirements
  • 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.

keyvalue
New links100 million a month
Kept for5 years
Custom codesnice to have
Click statslater

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
Next up: URL Shortener: Estimates — how big