Skip to main content

Caching patterns: cache-aside, write-through, write-back & stampedes

Compare cache-aside, write-through, and write-behind, and explain how to prevent thundering herds.

Official Reference

Model Answer & Explanation

Cache-aside (lazy load on miss, invalidate on write) is the 80% default—resilient to cache failure and only caches hot data. Write-through updates cache + DB synchronously (consistent, higher write latency). Write-back buffers writes in cache and flushes async (fast writes, risk of data loss). Stop stampedes with singleflight coalescing, mutex locks, or jittered TTLs.

Follow-up Interview Question · Describe a race condition where concurrent read + write leaves stale data permanently in cache-aside.

Module Context & References

System Design · Popular interview theory The 20% of distributed systems building blocks behind 80% of architecture rounds
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.