知识卡片
本地库可缩短可靠性路径
库在进程内运行,无需额外远程服务的网络往返与可用性依赖,适合本地高频处理。但它的故障和依赖也会进入宿主进程,仍须测试、观测并控制资源消耗。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第4章《Anti-Patterns: Internal Shared Libraries》(源文件:`_epub-src/OPS/ch04.xhtml`,归一化正文 [16673:20922))
- 结论依据:原文对比服务可能停机、变慢和资源耗尽,说明库可简化可靠性路径,同时警告嵌入代码仍可能成为风险。
- 原始内容:Libraries have less of those risks. By embedding libraries they are in essence become part of your service, and can lead to less complexity and more reliability. Of course, it’s not a free lunch - this is someone else’s software running in your code. The library still needs to be observable and resilient, otherwise, you’ve let a trojan horse into your codebase that could have dire effects.