L'invalidazione della cache — mantenere i dati memorizzati nella cache coerenti con la fonte di verità — è notoriamente uno dei problemi più difficili dell'informatica. La sfida consiste nel garantire che le cache non servano dati stantii bilanciando al contempo prestazioni, coerenza e complessità. Diverse strategie e insidie meritano di essere comprese.
Il problema fondamentale
When the source data changes, the cached copy becomes STALE.
→ Serve stale data? (fast but wrong) vs invalidate? (consistent but complex/slower)
→ "There are only two hard things in CS: cache invalidation and naming things."
The difficulty: knowing WHEN and WHAT to invalidate, across distributed systems,
without races, while keeping good cache hit rates.
