知识卡片

普通读书笔记卡 · 3469.f

产品库存边界需要合并

理解等级:高级

CoffeeMesh 示例若把产品目录与原料库存按团队拆成两个服务,目录每判断一种产品是否可售都要调用库存服务。书中据此判定两者高度耦合,应把两项能力放进同一服务。案例说明:团队边界只是初稿,实际请求依赖可能要求重新划界。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 3 章《Designing microservices》(源文件:_epub-src/OEBPS/Text/03.htm) - 结论依据:原文指出产品可用性取决于原料库存,拆开后每种产品都需跨服务查询,随后明确建议合并两项能力。 - 原始内容:To serve the CoffeeMesh catalogue, the products service needs to determine the availability of each product, which depends on the available stock of ingredients. Since the stock of ingredients data is owned by the ingredients service, the products service needs to make an API call per product to the ingredients service. ... There’s a high degree of coupling between the products and ingredients services, and therefore both business capabilities should be implemented within the same service.