Guided Lab Brief

Case Study: URL Shortener

Design a URL shortener like bit.ly - covering hashing, caching, database design, and redirect flow.

Overview

Design a URL shortener like bit.ly - covering hashing, caching, database design, and redirect flow.

Let's design a URL shortener (like bit.ly or tinyurl).

You will build 5 architecture steps that model production dependencies.

You will run 1 failure experiment to observe bottlenecks and recovery behavior.

Success target: Redirects complete in <10ms, cache handles 95% of reads, database is not overloaded.

Learning Objectives

  • Designed a complete URL shortener system
  • Understood read-heavy architecture optimization with caching
  • Learned about power-law traffic distribution
  • Experienced the impact of cache hit rate on system performance

Experiments

  1. Drop cache hit rate to understand why caching is crucial for read-heavy systems

Failure Modes to Trigger

  • Trigger: Drop cache hit rate to understand why caching is crucial for read-heavy systems

    Observe: At 30% hit rate, 3500 of 5000 rps hit the database. The DB can't handle this load - latency spikes, redirects slow to seconds. The whole point of a URL shortener (instant redirects) is broken.