知识卡片
TTL限制年龄不保证实时
TTL在写入或刷新后一段时间使缓存过期,可限制无其他失效机制时旧值存活时间。真源在TTL内改变仍可能读旧值,因此不能把TTL称为保证最新;有效期还要匹配业务容忍和加载成本。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Distributed Caching · 查看原书依据
A time-to-live (TTL) configuration ensures data does not go stale after a while. The more recent data is prioritized over older data. Consider a weather forecasting service: caching tomorrow’s forecast for a week makes little sense, the data has a natural lifetime after which it becomes not just stale but meaningless.
参考来源
- 位置:《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)
- 结论依据:原文的机制或对比支持以下核心判断:TTL在写入或刷新后一段时间使缓存过期,可限制无其他失效机制时旧值存活时间。 本卡将相邻说明中的适用限制保留为解释。
- 原始内容:A time-to-live (TTL) configuration ensures data does not go stale after a while. The more recent data is prioritized over older data. Consider a weather forecasting service: caching tomorrow’s forecast for a week makes little sense, the data has a natural lifetime after which it becomes not just stale but meaningless.