Domain-Driven Design gained more traction as microservices become more popular.

Domain-Driven Design can help to find microservices boundaries and make them deeper (compress public interfaces).

Boundaries

A balanced heuristic for designing microservices is to align the services with the boundaries of business subdomains.

The subdomains’ granularity and the focus on functionality (the “what” rather than the “how”) makes subdomains naturally deep modules. And related use cases in the subdomain also is an additional point for that.

It may be possible to go on more lower levels (depending on the environment) - to Bounded context or Aggregate boundaries levels. But most of the time it will be suboptimal.

  • Bounded context and microservices often use interchangeably, but even that microservice is a bounded context, this relation is not symmetric, and a bounded context is not necessarily a microservice.
  • Aggregate is the narrowest boundary possible. Decomposing it into multiple physical services will lead to undesired consequences.

Interface

Open-host service and Anticorruption layer can be used to simplify microservices’ public interfaces.

Open-Host Service

It introduces integration-oriented model with published language that reduces system’s Global complexity. It can expose less data and/or do so in a more convenient model for consumers.

A simpler public interface (function) with the same implementation (logic) makes service deeper and contributes to a more effective microservice design.

Anticorruption Layer

It works the other way around. It reduces the complexity of integrating the service with other bounded contexts.

Standalone ACL can reduce both the local complexity and global complexity by offloading integration complexity from the downstream and upstream bounded contexts (that leads to simpler public interfaces).