← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1980.z.6.b.2

Saga补偿由服务负责

理解等级:高级

Saga把跨服务业务分解为本地动作和对应补偿,每个服务同时拥有执行、撤销与幂等策略。协同式沿事件关系推进与回退,适合少步骤且顺序稳定的流程;编排式在中央保存进度,较易处理复杂分支、超时和取消。补偿失败也要有恢复路径;它是业务补救,不能等同于数据库事务的隔离与原子回滚。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Building Workflows with Microservices · 查看原书依据

      Distributed transactions in an event-driven world are often known as sagas and can be implemented through either a choreographed pattern or an orchestrator pattern. The saga pattern requires that the participating microservices be able to process reversal actions to revert their portion of the transaction. Both the regular processing actions and the reverting actions should be idempotent, such that any intermittent failures of the participating microservices do not leave the

    参考来源

    - 位置:《Building Event-Driven Microservices Leveraging Organizational Data at Scale (Adam Bellemare)》第08章《Building Workflows with Microservices》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Event-Driven Microservices Leveraging Organizational Data at Scale (Adam Bellemare)/_epub-src/OEBPS/ch08.xhtml;规范化段落起句:Distributed transactions in an event-driven world) - 结论依据:原文对该对象的定义、运行说明或对比支持以下归纳:Saga把跨服务业务分解为本地动作和对应补偿,每个服务同时拥有执行、撤销与幂等策略。本卡同时保留其适用条件与失败边界。 - 原始内容:Distributed transactions in an event-driven world are often known as sagas and can be implemented through either a choreographed pattern or an orchestrator pattern. The saga pattern requires that the participating microservices be able to process reversal actions to revert their portion of the transaction. Both the regular processing actions and the reverting actions should be idempotent, such that any intermittent failures of the participating microservices do not leave the