返回主题:引擎运行时与状态管理

知识卡片

问题卡 · 1968.v

工作流代理优先只读服务

理解等级:高级

已有服务不满足工作流契约而又暂时无法替换时,可以用代理补齐,但必须检查隐藏副作用。

工作流代理可补齐共享状态读写、表单、关联标识与执行/重复/撤销动作,把旧服务接入编排。只读校验或纯计算较易包装:重复计算不引入外部副作用,撤销只需清理共享状态结果。

写服务的困难在于代理看不到隐藏的依赖写入;删除自己创建的资源,不一定撤回工单、日志等连带变化。优先只读服务;只有掌控旧服务并能证明重复与撤销安全时才包装写动作。代理还增加故障链路,宜作为过渡而非永久掩盖不兼容。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体工作流 · 查看原书依据

      For reasons stated here, you should only proxy services that are read-only. The exception to this rule would be cases where you are in control of the noncompliant service and are confident you can safely support Revert and Repeat actions on that service. In general, you should steer clear of relying on workflow proxies if at all possible.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.20(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以工作流代理可补齐共享状态读写、表单、关联标识与执行/重复/撤销动作,把旧服务接入编排的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:For reasons stated here, you should only proxy services that are read-only. The exception to this rule would be cases where you are in control of the noncompliant service and are confident you can safely support Revert and Repeat actions on that service. In general, you should steer clear of relying on workflow proxies if at all possible.