Architecture Style and Service Boundaries
Question: should the system be one deployable unit or several, where should the boundaries go, and how do you move from one arrangement to the other?
Every other hub in this section depends on this answer. Once a design has several services, it needs answers for data across services, communication, the request path, containing failure, and operating services.
Forces
- Independent deployment and team autonomy: teams that release on their own schedule need parts they can change and deploy alone. Team structure and system structure tend to mirror each other (Conway’s law).
- Different scaling needs: a function with a distinct load profile can scale separately. See functional decomposition in scalability.
- Fault isolation: a failure in one service need not take down the others, provided failure is contained.
- Cost of distribution: network calls, partial failure, cross-service consistency, and more to deploy and observe.
- Cohesion and change: things that change together should stay together. A feature that needs changes in several services needs coordinated releases.
Architectural style
Defining properties of microservices (from the Newman excerpts in collected reading):
- Independent deployability: this is how releases are normally done, not only something that is possible.
- Modeled around a business domain: cross-service changes are expensive, so boundaries should make them rare.
- Owning their own state: other services ask for data through the service’s interface.
- Information hiding: the implementation can change freely as long as the networked interface stays compatible.
A modular monolith sits between the two: boundaries are enforced inside one deployable unit. Modularity concerns what can change independently, not only how the system is divided. See The Golden Age of Modularity.
In an interview: the extended framework collection advises designing a basic working system first, such as a monolith. It lists defaulting to microservices, or bringing Kafka, Kubernetes, and microservices to a small-scale problem, among common interview errors and biases. Walkthroughs often draw separate services anyway. Treat them as a logical decomposition and say whether they need to be deployed separately.
Where to draw boundaries
Heuristics for a boundary:
- Atomic invariants: keep data that must change atomically in one service.
- Coordinated changes: cut where changes rarely need coordination.
- Coupling: balance integration strength, distance, and volatility (Khononov). Strong coupling is acceptable between components that are close together or rarely change. See Coupling and Modularity for the full model.
- Ownership: check who owns the data each operation needs. A boundary that forces most requests to call several services is probably in the wrong place.
Refactoring to services
Newman (2020) adds:
- branch by abstraction: replace an implementation behind an abstraction inside the monolith;
- parallel run: run old and new implementations side by side and compare their results (see the deployment notes);
- decorating collaborator and change data capture;
- a chapter on decomposing the database.
He also argues for not migrating when the goals do not require it.
Leads to
- Private data per service leads to data across services.
- Services that call each other lead to communication and the request path.
- More deployable units lead to operating services and containing failure.
Seen in cases
- Ticketmaster: separates event browsing from booking. The two have different load and consistency needs.
- Scalability: functional decomposition as one of four scaling strategies.
- AI and RAG: the boundary map in design pressure splits a single-turn RAG and tool assistant into modules that can each be tested with fixtures. The boundaries are at code scale, but they are chosen by the same question: what must change and be verified independently.
Gaps
- A worked decomposition of one case by capability and by subdomain, comparing the results.
- Domain-driven design: bounded contexts and context mapping. The ACL is one context-mapping pattern.
- Team structure: Newman, chapter 15.
Sources
- Monolithic architecture, microservice architecture, decompose by business capability, decompose by subdomain, self-contained service, service per team, strangler application, anti-corruption layer – microservices.io. Full pattern index.
- Microservices – Martin Fowler and James Lewis and Microservices and the First Law of Distributed Objects.
- The microservices chapter of Fundamentals of Software Architecture (Richards and Ford).
- Video: noted as good, including its comments.
- Richardson 2019: chapter 2 (decomposition), chapter 13 (refactoring). Newman 2021: chapters 1-3 and 15. Newman 2020: chapters 1-3.
Library sources
- Newman 2020, Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith – on Refactoring to services
- Newman 2021, Building Microservices: Designing Fine-Grained Systems, Second Edition – on Architectural style
- Richardson 2019, Microservices Patterns: With Examples in Java – chapters 2 and 13
- Khononov 2025, Balancing Coupling in Software Design – on Where to draw boundaries
- Wlaschin 2018, Domain Modeling Made Functional – chapter 1, “Creating a Solution Using Bounded Contexts” (guidelines for drawing contexts, context maps, core, supportive and generic domains), and chapter 3, “Bounded Contexts as Autonomous Software Components” (monolith first, the distributed monolith) and “Contracts Between Bounded Contexts” (shared kernel, customer/supplier, conformist, anti-corruption layer); on Where to draw boundaries, Refactoring to services and Gaps
Further reading:
- Richards and Ford 2025, Fundamentals of Software Architecture, 2nd Edition
- Dragoni et al. 2017, Microservices: yesterday, today, and tomorrow (arXiv:1606.04036)
- Gandhi et al. 2024, Head First Software Architecture