知识卡片
缓存与数据库并非原子
数据库更新和缓存更新往往不在同一事务中,一处成功而另一处失败就可能读到旧值。评估缓存方案时要明确容忍的陈旧程度与失效处理,不能把增加缓存只当作没有一致性代价的提速。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 从单机逐步扩展 · 查看原书依据
Consistency: This involves keeping the data store and the cache in sync. Inconsistency can happen because data-modifying operations on the data store and cache are not in a single transaction. When scaling across multiple regions, maintaining consistency between the data store and cache is challenging. For further details, refer to the paper titled “Scaling Memcache at Facebook” published by Facebook [7]. •Mitigating failures: A single
参考来源
- 位置:《System Design Interview – An insiders guide, Second Edition》第01章《从单机逐步扩展》(来源项目 book-sources;源文件:extracted/System Design Interview – An insiders guide, Second Edition/_epub-src/text/part0004_split_006.html)
- 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。
- 原始内容:Consistency: This involves keeping the data store and the cache in sync. Inconsistency can happen because data-modifying operations on the data store and cache are not in a single transaction. When scaling across multiple regions, maintaining consistency between the data store and cache is challenging. For further details, refer to the paper titled “Scaling Memcache at Facebook” published by Facebook [7]. •Mitigating failures: A single