System Design Advanced

05  Capstone: URL Shortener

The classic, end to end. A URL shortener looks trivial until the numbers arrive -- which is exactly why it tests everything at once: estimation, key design, storage, caching, and the evolution story when product asks for more.

Step 2 / 2

The shortener took off. Product adds custom aliases (users pick their own short name) and per-link click analytics -- while redirect traffic grows 10x to 40,000/s. Say what changes: how aliases affect key generation, how you count clicks without slowing redirects, and how the read path survives 10x.

Hints
  • Custom aliases turn key generation into a uniqueness problem: someone must lose the race for a popular name. Which layer enforces that?
  • Never do analytics work inside the redirect: emit an event and move on. What absorbs 40,000 events per second?
  • At 10x reads, the cache hit rate and what sits in front of the cache matter more than the database. Think edge serving and hot-key protection.
Your design is reviewed against a hidden rubric.