Domain Model Microservices
The question is then to know if you want.
Domain model microservices. Shared domain model between different microservices. Now if you agree on the solution above we have a user microservice encapsulating domain model for user and all other services are consumers of the same microservice. Keep in mind however that a bc or business microservice could sometimes be composed of several physical services that share a single domain model.
Our former article presents an overview of activities for building microservice based appli cations by using a domain driven design ddd approach. Introduction this article is an extended version of 1 which was published at softeng 2017. Define one rich domain model for each business microservice or bounded context.
In summary when you design microservices for an application use the principles of domain driven design to guide you along the way. The concept of microservices did not exist at that time. Keep in mind however that a bc or business microservice could sometimes be composed of several physical services that share a single domain model.
Additionally the domain model layer includes the repository contracts interfaces that are the infrastructure requirements of your domain model. The domain model must capture the rules behavior business language and constraints of the single bounded context or business microservice that it represents. Microservices is an application architectural style with a clear bounded context interface and dependencies emerged from the domain driven design architectural patterns and devops.
Then use what you learned to define and design your microservices. These applications are hosted and available over the network and expose a well defined interface. The domain entity pattern.
Your goal is to create a single cohesive domain model for each business microservice or bounded context bc. In other words these interfaces express what repositories and the methods the infrastructure layer must implement. As opposed to the fairly large services of the 2000s microservices are applications that represent a set of narrowly scoped functionality.