知识卡片
服务接口隔开内部依赖图
服务 A 调用服务 B 的接口时,通常无需共享 B 的操作系统、内部库和数据库版本;若 A 直接引用内部库,则常被迫共享语言与依赖图。接口边界因此可降低二进制耦合,让升级更独立。但服务间若继续共享库或数据库,隔离收益会被削弱,不能只凭服务数量判断。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第1章《What’s Wrong with Monoliths?》(源文件:`_epub-src/OPS/ch01.xhtml`,归一化正文 [33388:37630))
- 结论依据:原文明确对比服务间调用与内部库调用对操作系统、库、数据库、语言和依赖图的约束,并补充服务也可能遭遇二进制耦合。
- 原始内容:By contrast, when a service A calls another service B, service A is not highly coupled with the operating system, internal libraries, and database of service B. Services provide natural decoupling and separation of concerns. However, when an internal library C calls another library D, they are coupled and restricted in many ways. They are forced to use the same language and share all the dependency graphs, which impose further coupling and limitations.