liveBook · Manning

Domain-driven design

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

Domain-driven design is a software design approach that models software around the concepts and boundaries of its problem domain.

Domain-driven design (DDD) models a business as software by organizing its concepts, entities, terms, and logic into consistent, self-contained bounded contexts. section 1.14.3

For microservices, each bounded context provides a practical boundary for deciding what belongs in a service and how domain concepts relate across services. section 1.14.3 section 1.16

Apply the technique by:

  • Modeling the business domain and identifying concepts that belong together. section 1.14.3
  • Drawing bounded contexts around terms, entities, and logic that remain consistent within each boundary. section 1.14.3
  • Using those contexts to determine what each microservice should contain. section 1.14.3
  • Revisiting the architecture and conversion plan as understanding changes, while involving the wider team and business. section 12.6.2

Video-streaming domain

A video-streaming system can place User, Like, and Video within microservices. Video may connect recommendation and video-storage services while retaining slightly different meanings in each context. section 1.14.3

Figure 1.8 Bounded contexts from DDD equate to the boundaries of microservices.

Use the bounded-context diagram to see how domain boundaries can align with microservice boundaries. section 1.14.3

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Defines bounded contexts and applies them to service boundaries, but stops short of detailed implementation procedures.
Examples
Uses a video-streaming domain containing User, Like, and Video across recommendation and video-storage services.
What it assumes
Assumes familiarity with business domains and microservices, while defining bounded contexts through a concrete service-design problem.
What you can do after
Build it from scratch by modeling domain boundaries and mapping bounded contexts to microservices.
How it connects
Connects bounded contexts with microservices, distributed applications, loose coupling, high cohesion, and the single responsibility principle.

Also explained in

Compare how 7 books explain domain-driven design →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.