知识卡片
幂等让重复交付可恢复
幂等操作收到相同业务请求多次,效果仍等同一次。这样失败后重发、至少一次交付更容易处理,宏观架构不必为每一次网络不确定性引入复杂事务。幂等是业务状态转换的性质,不能仅按HTTP方法名判断,也不自动提供跨服务隔离;是否需要事务仍取决于多个状态是否必须共同成立。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 服务端架构 · 查看原书依据
Idempotent operations do not have any effect even if they receive multiple copies of the same request, so make service operations idempotent whenever possible. Then it is easy to recover, and you can live with at least one delivery.
参考来源
- 位置:《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)
- 结论依据:摘录说明幂等操作收到相同业务请求多次,效果仍等同一次。其余条件结合本章相邻例子与取舍说明,数字示例不作当前性能承诺。
- 原始内容:Idempotent operations do not have any effect even if they receive multiple copies of the same request, so make service operations idempotent whenever possible. Then it is easy to recover, and you can live with at least one delivery.