知识卡片
总依赖他人暗示边界错误
如果一个服务连单个请求都无法独立完成,必须每次调用另一个服务,本章将其视为职责分界不清的信号,建议重设边界或合并。这个判据针对持续、必需的调用依赖;它并不等于禁止任何跨服务协作。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 3 章《Designing microservices》(源文件:_epub-src/OEBPS/Text/03.htm)
- 结论依据:原文以预测服务每次依赖历史数据服务为例,明确说这种请求级必需调用代表紧耦合,给出重设计或合并的处理方向。
- 原始内容:If we have a service that can’t fulfill a single request without calling another service, there’s no clear separation of concerns between both services and they belong together. ... The solution is to redesign both services so that they don’t rely on each other, or to merge them into a single service.