Metti un layer cache-aside (Redis/Memcached) davanti al DB così che le letture colpiscano la memoria, dai alle voci un TTL e invalida in scrittura, aggiungi protezione dallo stampede così che una chiave fredda non scateni un thundering herd sul DB, e distribuisci le hot key tra le replica così che una chiave popolare non fonda un singolo nodo.
┌── hit ──▶ return value
request ──▶ cache│
└── miss ─▶ lock ─▶ DB read ─▶ set(TTL) ─▶ return
│
(only ONE miss populates; others wait)
DB writes ──▶ invalidate/update key
