Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 1 of 9: Every redirect reads the store

STEP 1 / 9ORIGINAL SKETCH
GET /abc123read alias302 LocationBrowserRedirect serviceAlias storesource of truth!4,000 reads/s, one row
A browser asks a redirect service for a short link; the service checks a cache, falls back to the alias store on a miss, checks a disabled list, and a link owner or moderator can edit the store, purge the cache, or disable a link.

Where the time goesIllustrative · see assumptions

  • Store read8 ms

Total ≈ 8 ms

1 / 9
  1. No cache
  2. Add a cache
  3. Cache hit
  4. Cache miss
  5. Link changes
  6. Stale hit
  7. TTL bounds it
  8. Purge
  9. Deny-list

STEP 1 OF 9 · NO CACHE

Every redirect reads the store

A browser asks for /abc123. The redirect service reads the alias row from the store and answers 302 with the long URL in the Location header.

That is fine at 400 requests per second spread over many links. At 4,000 per second for one link, every request hits the same row on the same store node, and that node becomes the bottleneck.

Why it matters. Caches are worth adding when reads repeat. A skewed workload, where a few keys get most of the traffic, is the clearest case.