mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-25 04:17:17 +00:00
docs: Hybrid、领域驱动设计与 BFF、项目复盘
This commit is contained in:
11
Chapter3 - Server/3.10.md
Normal file
11
Chapter3 - Server/3.10.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 领域驱动设计与中后台、BFF的关系
|
||||
|
||||
|
||||
1. DDD 将业务拆分为多个领域,比如订单、商品...。每个域的服务是单独可以运行、维护的。比如订单域有10台机器,1台负载均衡,9台真正做事情的机器。有任务过来调度器进行任务派发。
|
||||
2. 客户端或者大前端都存在模块的概念。比如商品、订单,也是以 Pods 的形式去维护,每个领域的代码都单独可以运行、维护。模块之间不存在耦合关系,通过接口的形式去能力发现、能力调用。比如订单域通过某个接口访问某个商品详情的能力
|
||||
3. DDD 的最佳实践是不是微服务。比如订单服务所在的工程,可以单独运行、维护。
|
||||
4. 基于微服务,肯定需要一个 BFF 层,扮演业务编排、字段转换。比如订单域的模型有100个字段。但是订单的接口为客户端服务,客户端(通过接口找2018~2020年的、待付款的订单),BFF 层就去扮演数据组装、字段筛选的作用。
|
||||
|
||||
|
||||
- https://tech.meituan.com/2017/12/22/ddd-in-practice.html
|
||||
- https://juejin.cn/post/6997250621627858957#heading-3
|
||||
@@ -11,4 +11,5 @@
|
||||
* [6、YAML](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.6.md)
|
||||
* [7、Node单元测试](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.7.md)
|
||||
* [8、数据安全(反爬虫)之「防重放」策略](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.8.md)
|
||||
* [9、爬取疫情数据并用 Markdown 预览](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.9.md)
|
||||
* [9、爬取疫情数据并用 Markdown 预览](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.9.md)
|
||||
* [10、领域驱动设计与中后台、BFF的关系](https://github.com/FantasticLBP/knowledge-kit/blob/master/Chapter3%20-%20Server/3.10.md)
|
||||
Reference in New Issue
Block a user