DB 앞에 cache-aside 계층(Redis/Memcached)을 두어 read가 메모리를 치게 하고, 항목에 TTL을 주고 write 시 무효화하며, cold key가 DB에 thundering herd를 풀어놓지 못하도록 stampede 보호를 추가하고, 하나의 인기 key가 단일 노드를 녹이지 않도록 hot key를 replica에 분산하십시오.
┌── hit ──▶ return value
request ──▶ cache│
└── miss ─▶ lock ─▶ DB read ─▶ set(TTL) ─▶ return
│
(only ONE miss populates; others wait)
DB writes ──▶ invalidate/update key
