URL Shortener & Link Management Service · View 09 of 23 · Structure
Order matters
- Deny-set before the lookup ladder: a revoked code must not be answerable from any cache layer, which makes revocation independent of cache invalidation.
- Coalescing before L1: one origin fetch per code per instance, so a viral cold code produces one read rather than 80,000.
- Terminal-state selection last, so an expired, blocked and unknown code cannot collapse into the same response.
The lookup ladder
- L1 in-process LRU, 10 s TTL — the hot-key absorber; L2 regional Redis — the working set; L3 in-region Cosmos replica — the cold path.
- Assumption: 97% of clicks never reach L1 at all because the edge response cache answers them; of the misses, 97% stop at L1 or L2.
- Cold path budget: p99 ≤ 120 ms including the regional read.
After the response
- Click emission, the durable local buffer and the hot-code counters all run after the redirect has been sent. None of them can fail a click.
- Hot-code counters are a promotion signal only; nothing on the request path reads them.