The capstone board of the System Design track. Every earlier board taught one box. This one takes a blank prompt, “design a URL shortener”, and shows which boxes the numbers pay for, and which ones the numbers refuse.
Before you start. You need the five things the earlier lessons built, and one clause each is enough to bring them back: a load balancer (one public address in front of many identical servers), a cache (a small fast copy of the answers people ask for most), a read replica (a second database that only answers reads), a shard (one database split across machines by key), and a log (an append-only record of things that happened). You also need to be able to multiply and divide numbers like 100 million and 86,400 in your head, badly, to one digit.
Lesson 39 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.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
Forty minutes, a blank whiteboard, and a question that sounds like “invent something”
January 2002: TinyURL, one man, and a database nobody ever had to split
The six questions, always in this order
The first number: QPS, and why a hundred million a month is small
The second number: 3 TB, and the shard the arithmetic refuses
The number that actually decides it: the hit rate, not the read rate
The short code: base62, and the birthday estimate that kills the hash
2012: Lady Gaga, five minutes, and fan-out
Step 3, the API, and step 4, the data model
Step 6, the bottlenecks, and the lesson each one calls for
The feed, in numbers
Terms it explains: System Design, QPS, back-of-the-envelope, base62, birthday estimate, fan-out, pairs, Reads are the load, Storage and writes grow, Bursts and side effects, Correctness under partition.