← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 5382.a

确定性重放恢复本地状态

理解等级:中级

若服务没有未记录的随机性,相同起始状态和相同输入序列可重建相同状态。输入不只用户请求,还包括影响计算的定时触发等事件。因此可以持久化输入并重放恢复,避免每一步都写完整状态。条件是顺序、初始状态、代码语义及非确定输入都受控;记录部分消息却忽略时间或外部依赖,并不构成完整重放。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 服务端架构 · 查看原书依据

      Given a service that does not have randomness (a.k.a. a deterministic service), we can reconstruct its state by recording and replaying all its inputs (including timer interrupts). The reason is that a deterministic service’s output depends only on its input.

    参考来源

    - 位置:《Software Architecture and Decision-Making》第11章《Server Architectures》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch11.xhtml) - 结论依据:摘录说明若服务没有未记录的随机性,相同起始状态和相同输入序列可重建相同状态。其余条件结合本章相邻例子与取舍说明,数字示例不作当前性能承诺。 - 原始内容:Given a service that does not have randomness (a.k.a. a deterministic service), we can reconstruct its state by recording and replaying all its inputs (including timer interrupts). The reason is that a deterministic service’s output depends only on its input.