知识卡片
补偿适用性有三道门槛
有限成本的补偿要求每步结果可验证、写入或外部副作用不依赖可变状态的先前读取,并且失败能采取补偿。读后决定写在并发下会遭遇状态变化,单靠逆向动作很难恢复隔离;不满足条件时应重新划事务边界或采用具备相应保证的协调。把中间进展存入数据库或队列可帮助续跑,但仍须另行保证重复操作安全。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 保持状态一致 · 查看原书依据
Condition 1: Each individual operation can be verified. Condition 2: The system does not have writes or side effects that cause operations to depend on a read from a mutable state. Condition 3: We can handle the failure or take compensative actions.
参考来源
- 位置:《Software Architecture and Decision-Making》第07章《保持状态一致》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch07.xhtml)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:Condition 1: Each individual operation can be verified. Condition 2: The system does not have writes or side effects that cause operations to depend on a read from a mutable state. Condition 3: We can handle the failure or take compensative actions.