Skip to content

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

PatternMechanismFits whenCosts and what it leads to
Monolithic architectureThe application is one deployable unit. It can still be modular inside.A small team, an early product, or a domain whose boundaries are still unclear.Every change ships together; one scaling profile; without modular discipline the code loses its internal boundaries.
Microservice architectureA collection of independently deployable, loosely coupled services, each owning its data.Several teams need to release independently, or parts of the system have very different scaling, availability, or technology needs.Everything in the other hubs: distributed data, communication, discovery, failure handling, deployment, and observability.

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

PatternMechanismFits whenCosts and what it leads to
Decompose by business capabilityServices correspond to what the business does, such as order management or delivery.Capabilities are stable and recognizable.Capabilities can be coarse; requires understanding the business.
Decompose by subdomainServices correspond to domain-driven design subdomains (core, supporting, generic) and their bounded contexts.The domain is complex enough to justify modeling it.Modeling effort; boundaries shift as understanding improves.
Self-contained serviceA service can answer synchronous requests without waiting for other services.A request path must stay available when other services are down.Relies on local copies of other services’ data, so it is eventually consistent. See CQRS and command-side replicas.
Service per teamEach team owns one service.Team boundaries match domain boundaries; autonomy is the main goal.The team structure determines the service size.

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

PatternMechanismFits whenCosts and what it leads to
Strangler applicationRoute functionality incrementally to new services around the existing system until the old one can be retired.An existing system must keep running during the migration.Two systems run in parallel for a long time; a routing layer to maintain.
Anti-corruption layerA translation layer between the new service’s model and the legacy model.The legacy model would otherwise leak into the new design.Translation code to maintain.

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

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

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: