liveBook · Manning

Service boundary

As explained in Microservices Patterns, Second Edition

A service boundary is a division that defines the responsibilities and scope of a service within a distributed application.

A service boundary assigns responsibilities and scope. A useful division keeps services loosely coupled at design time and makes most changes local to one service. section 1.3.4 section 7.5.2

When choosing boundaries:

  • Keep performance-critical operations within one service, even if that makes it larger. section 1.3.4
  • Avoid excessive fine-grained services, which add network overhead and runtime coupling. section 1.3.4
  • Plan for breaking API changes to require incremental versioning and coordinated client migration. section 7.5.2

Order-history query

A Delivery Service cannot filter orders by menu item because it does not know their contents. A query like this may call for API composition, CQRS, or boundaries that make the query local to one service. section 12.2.4

Figure 1.13 Some, but not all, operations in a microservice architecture will span multiple services. Distributed operations are more complicated to design because services are process and transaction boundaries. This creates numerous design challenges since the network is not free, it’s unreliable, and not all services are guaranteed to be simultaneously available. You must also use an unfamiliar transaction model known as eventual consistency.
distributed operations challenges

Use the figure to see why operations spanning service boundaries face network, availability, and transaction challenges. section 1.3.4

How Microservices Patterns, Second Edition covers it

How deep it goes
Relates boundary quality to coupling, performance placement, granularity, and cross-service change costs.
Examples
Uses an order-history query that cannot filter by menu item within the Delivery Service.
What you can do after
Evaluate boundary choices by weighing local-change autonomy against coordination, network overhead, and runtime coupling.
How it connects
Connects microservice design to API evolution, API composition, CQRS, and eventual consistency.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.