Cache Invalidation & Consistency — Vấn Đề Khó Nhất Trong Distributed Systems
Phil Karlton nói: "There are only two hard things in Computer Science: cache invalidation and naming things." Câu này vừa hài hước vừa đúng đến mức đáng sợ. Cache invalidation sai dẫn đến stale data, thundering herd, và những bug race condition cực kỳ khó reproduce.
Bài này đi sâu vào những vấn đề thực tế: cache stampede xảy ra như thế nào và các pattern để ngăn (mutex, probabilistic early expiration, background refresh), tag-based invalidation cho content với nhiều dependency, distributed cache coherence khi scale multi-region, và stale-while-revalidate — pattern dùng rộng rãi trong HTTP caching mà ít engineer áp dụng đúng vào application cache.
Sẽ sớm cập nhật.