知识卡片
微服务边界封装领域与数据
微服务把限界上下文从逻辑划分推进到物理边界:一个服务围绕一项功能、子域或工作流,封装完成它所需的代码、数据模式和数据存储。边界内可紧密协作,边界外通过明确契约交互,避免跨服务共享同一个类定义或数据库表。例如两个子域都要“地址”,可各自定义所需字段,而不强推一个通用 Address 类。这里允许有意重复,以减少共享实现带来的变更耦合;它不意味着服务之间完全没有通信。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Microservices Architecture · 查看原书依据
Each bounded context, then, includes everything necessary to operate within that function or subdomain—including services consisting of logical components and classes, database schemas, and the corresponding database the service requires to carry out its functions.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第18章《Microservices Architecture》(阅读计划第21项,单元01与04;源文件:`OEBPS/ch18.html`)
- 结论依据:原书以DDD限界上下文说明服务需包含自身代码与数据,举共用Address类的反例,并明确微服务倾向用重复换取解耦;契约交互是对“share nothing”边界的限定解释。
- 原始内容:Each bounded context, then, includes everything necessary to operate within that function or subdomain—including services consisting of logical components and classes, database schemas, and the corresponding database the service requires to carry out its functions.