Distributed Caching with Redis
Use probabilistic early expiration and request coalescing to avoid stampede.
flowchart TD
A[Request] --> B{Cache hit?}
B -->|yes| C[Return cached value]
B -->|no| D[Fetch from DB]
D --> E[Write cache with TTL + jitter]