Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 12 · System Design · The questions that keep coming up · about 20 min to read

Watch: Caching properly: write strategies, stampedes, and invalidation
▶ VideoPlay it as a journeyTutor comes with a plan

Design a URL shortener (a coat check for web addresses, on one machine and then for the world)

The Slate, Properly
The Slate, Properly · Open board

The cache drawn with the engineering on it: what a saved copy is worth, what makes it lie, and the failure that hits when one answer is wanted by everybody at once. A shortener’s read path is that picture.

Before you start. You need the six steps from Design the Whole Thing (the interview, assembled): ask, estimate, API, data, design, bottlenecks, with nothing on the whiteboard until a number pays for it. That lesson used “design a URL shortener” as its blank prompt, and this one takes the prompt all the way down. The Slate, Properly (caching to real depth) gave you the cache, a small fast copy of the answers people ask for most, and the hit rate that measures it. Splitting the ledger (sharding) gave you sharding, one database cut into pieces by a key, which only matters here once the numbers get large.

Lesson 66 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • January 2002: a very long address and a unicycle
  • 2009: a promise that has to outlive the company
  • The first number: how many tickets exist, and base 62
  • Handing out tickets: a counter, a hash, or a die
  • Key pre-generation: a stack of tickets printed before the doors open
  • 2009 again: the redirect, and the one number in the response
  • The hot link: one ticket a million people want
  • 1. Requirements
  • 2. Out of scope, said out loud
  • 3. Targets
  • 4. Estimates that change the design
  • 5. Entities and API
  • 6. Storage, with the trade said plainly
  • 7. The design, one requirement at a time
  • 8. Deep dives
  • 9. What each level adds
  • 10. The follow-up: let a link be edited

Terms it explains: short code, base 62, Key pre-generation, key service, redirect, 301, 302, hot link, Common mistakes, 6, 62, link, click.

Related paper

Review System Design