知识卡片
服务选型需计算远程成本
服务增加网络传输、部署与可用性路径;需要数据就地计算、功能很小且少变或服务数量已过多时,可考虑进程内库或并入现有服务。应按具体负载、维护和故障代价判断。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第6章《Principles of Proper Services》(源文件:`_epub-src/OPS/ch06.xhtml`,归一化正文 [4214:8435))
- 结论依据:原文在避免建服务一节列出性能、复杂度与可靠性路径三类限制,并以节假日计算示例说明本地库可能更合适。
- 原始内容:Performance: Scenarios where you want the computation close to the data, so move the computation but do not move the data. Internal shared libraries are local and embedded, but services by nature are remote and there is a cost in sending data to a service. Examples would be uploading files to S3. Complexity: Sometimes you have too many services, and every service you add will increase your complexity. Consider having fewer services, or adding the code to an existing service.