缓存的一致性。Meta的缓存失效解决方案

Caches help reduce latency, scale read-heavy workloads, and save cost. They are literally everywhere. Caches run on your phone and in your browser. For example, CDNs and DNS are essentially geo-replicated caches. It’s thanks to many caches working behind the scenes that you can read this blog post right now.

缓存有助于减少延迟,扩展重读工作负载,并节省成本。它们实际上是无处不在的。缓存在你的手机和你的浏览器中运行。例如,CDN和DNS本质上是地理复制的缓冲区。正是由于许多缓存在幕后工作,你现在可以阅读这篇博文。

Phil Karlton famously said, “There are only two hard things in computer science: cache invalidation and naming things.” If you have ever worked on a cache that uses invalidations, chances are you have run into the annoying problem of cache inconsistency.

菲尔-卡尔顿有句名言:"计算机科学中只有两件难事:缓存失效和事物的命名"。如果你曾经在一个使用失效的缓存上工作过,那么你很有可能遇到过缓存不一致这个恼人的问题。

At Meta, we operate some of the largest cache deployments in the world, including TAO and Memcache. Over the years, we’ve improved TAO’s cache consistency by one measure, from 99.9999 percent (six nines) to 99.99999999 percent (10 nines). 

在Meta,我们运营着世界上最大的一些高速缓存部署,包括TAOMemcache。多年来,我们将TAO的缓存一致性提高了一个档次,从99.9999%(六个九)提高到99.99999999%(十个九)。

When it comes to cache invalidation, we believe we now have an effective solution to bridge the gap between theory and practice. The principle and methodology in this blog post apply broadly to most, if not all, cache services at any scale. It does so whether you are caching Postgres data in Redis or maintaining a disaggregated materialization.

当涉及到缓存失效时,我们相信我们现在有一个有效的解决方案来弥补理论和实践之间的差距。这篇博文中的原理和方法广泛适用于大多数(如果不是全部)任何规模的缓存服务。无论你是在Redis中缓存Postgres的数据,还是维护一个分解的物化,它都是如此。

We want to help reduce the number of cache invalidation issues that engineers have to deal with and help make all caches with invalidations more consistent.

我们希望帮助减少工程师必须处理的缓存失效问题的数量,并帮助使所有有失效问题的缓存更加一致。

Defining cache invalidation and cache consistency 

定义缓存的无效性和缓存的一致性

By definition, a cache doesn’t hold the source of truth of your data (e.g., a database). Cache invalidation describes the process of actively invalidating stale cache entries when data in the source of truth mutates. I...

开通本站会员,查看完整译文。

trang chủ - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.3. UTC+08:00, 2024-11-29 01:56
浙ICP备14020137号-1 $bản đồ khách truy cập$