官术网_书友最值得收藏!

Using DDD in microservices

Now that we have a clearer understanding of what DDD is, we need to review how we are going to apply it to our microservices. We could start with the following points:

  • Bounded Context: We should never create a microservice that includes more than one bounded context: it is better if we can map that whole context to a single microservice, something that indicates that our context is really bounded
  • Ubiquitous Language: We need to ensure that the language that our microservice speaks with is ubiquitous, so the operations and interfaces that are exposed are expressed in the context domain language
  • Context Model: The model that our microservice uses should be defined within the bounded context and use the ubiquitous language, even for entities that are not exposed in any of the interfaces that the microservices provide
  • Context Mapping: Finally, we need to review the context mapping of the whole system to understand the dependencies and coupling of our microservices

After reviewing these points, we will notice that we are in fact fulfilling the main principles defined before. Our microservices are modelled around business capabilities, our context domains, are loosely coupled as our context mapping shows, and have a single responsibility as a bound context should. Microservices that implement a bounded context could easily hide their implementation, and they will be nature isolated, so we could deploy them independently. Having those principles in place will make it easy to build for failure, having scalability and automation. Finally, having a microservice architecture that follows DDD will deliver a clean architecture that any team member could understand.


The ubiquitous language of a well-designed bounded context will make many tasks easy in a microservice life cycle, from working with the domain experts to tests or any tasks for the ops function of our team.
主站蜘蛛池模板: 浦东新区| 贺州市| 甘孜县| 龙山县| 措美县| 英山县| 来宾市| 霍城县| 遂川县| 鸡泽县| 津南区| 丰镇市| 江孜县| 闽侯县| 泸水县| 平江县| 大城县| 蛟河市| 金华市| 宣城市| 金溪县| 郸城县| 石台县| 昌平区| 晋城| 靖州| 丹寨县| 阿拉尔市| 东乡族自治县| 博白县| 苍溪县| 连山| 尉氏县| 大同市| 南阳市| 和静县| 吉安市| 杭州市| 宁蒗| 保靖县| 措勤县|