How would you approach caching within a microservices architecture, and what are the pitfalls of shared cache state?

Last updated 3 July 2026

  • Cache at the gateway or client (HTTP Cache-Control, CDNs) and per service (local or Redis) using cache-aside or read/write-through. Invalidate with TTLs plus event-driven eviction.

  • Shared cache pitfalls: hidden coupling and schema lock-in, no clear invalidation owner (so stale data lingers), and a single point of failure or contention hotspot.

  • Prefer private per-service caches, or namespaced keys with one writer per key. Design for stale reads and stampedes (locks, request coalescing, jittered TTLs).

  • https://learn.microsoft.com/en-us/azure/architecture/best-practices/caching
  • https://algomaster.io/learn/system-design/distributed-caching
  • https://devbranch.net/how-caching-works-memory-disk-and-distributed-caches-explained/
All Microservices interview questions