← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2313.e.5.f.10.b.3.e.1.a.1.b.1.a

写穿不自动原子一致

理解等级:高级

写穿希望写入同步到缓存及持久存储后才确认,增加写等待。原书“先数据库成功再cache.set”是两个操作,缓存失败或并发覆盖仍会出现旧值;顺序执行不能证明两处原子更新或所有读取永远最新。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Distributed Caching · 查看原书依据

      Write-through cache is a caching strategy that simultaneously writes data to the cache and the main memory. This ensures that the cache and main memory are always consistent. In this mechanism, the application updates the primary database, the data is then immediately written to the cache.

    参考来源

    - 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第11章《Distributed Caching》(来源项目book-sources;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch11.xhtml) - 结论依据:原文给出本卡对应定义或示例;写穿希望写入同步到缓存及持久存储后才确认,增加写等待。 对原文省略和过度承诺的限定是本卡显式纠正,不能反过来当作原书已证明。 - 原始内容:Write-through cache is a caching strategy that simultaneously writes data to the cache and the main memory. This ensures that the cache and main memory are always consistent. In this mechanism, the application updates the primary database, the data is then immediately written to the cache.