liveBook · Manning

Chapter 7: The Microservice architecture: enabling fast sustainable flow

What you will learn in chapter 7 of Microservices Patterns, Second Edition

The introduction explains when outgrowing a monolith can make migration to microservices sensible, then previews the chapter.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains when outgrowing a monolith can make migration to microservices sensible, then previews the chapter.

Key terms: monolithic architecture, microservice architecture, fast flow, maintainability, testability, deployability

7.1 What is the microservice architecture exactly?

The section explains why a precise definition of microservice architecture matters before evaluating its trade-offs.

Key terms: microservice architecture, services, benefits, drawbacks, trade-offs

7.1.1 My definition of the microservice architecture

Defines the microservice architecture through its services, subdomains, loose coupling, and independent deployability.

Key terms: architectural style, subdomains, services, component, deployable unit, loosely coupled

7.1.2 Some other popular definitions

The section presents popular definitions of microservices and notes that they do not fully capture the qualities the author considers essential for fast, sustainable flow.

Key terms: small services, business capabilities, lightweight mechanisms, independently deployable, loosely coupled, bounded contexts, replaceability, fast, sustainable flow

7.1.3 Comparing two definitions of the microservice architecture

This section compares the author’s and Fowler’s definitions of microservice architecture, highlighting their shared ideas and the author’s reasons for emphasizing fast flow and loose coupling over service size or replaceability.

Key terms: business capabilities, subdomains, independent deployability, automated deployment, multiple technology stacks, size, fast flow quality attributes, replaceability, evolvability, API

7.2 There’s more to the microservice architecture than just services

This section explains why defining microservice architecture only in terms of services misses important operational, build, and team dimensions.

Key terms: component view, system operations, build architecture dimension, service-team relationship, distributed system operations, subdomains, independently deployable services, fast flow

7.2.1 Services in a microservice architecture

This section uses a small example to show the high-level components of a microservice architecture and notes what it may look like during migration from a monolith.

Key terms: services, API Gateway, component view, monolith, services extracted from it, new functionality

7.2.2 The structure of a service

This section describes a service’s subdomains, API, and private database, then distinguishes operations that implement system operations from those used for service collaboration.

Key terms: service, subdomain, API, private implementation detail, shared library, operations, events, system operations, collaboration, synchronously

7.2.3 Operations in a microservice architecture

This section distinguishes local from distributed system operations and explains how a distributed operation begins and involves multiple services.

Key terms: system operations, local operations, distributed operations, distributed operation, entry point, collaborates

7.2.4 Build architecture dimension

This section explains how multi-repo and monorepo build architectures support—or complicate—independent service deployment.

Key terms: build architecture dimension, independently deployable services, multi-repo, monorepo, deployment pipeline, global changes

7.2.5 Services <⇒ teams

This section explains how service ownership affects team autonomy and why services and teams do not always map one-to-one.

Key terms: service, team, loosely design-time coupled, team’s autonomy, subdomains, shared library, collocated, autonomy

7.3 Essential characteristics of the microservice architecture

This section identifies the two characteristics services need to deliver the benefits of a microservice architecture and warns what happens without them.

Key terms: independently deployable, loosely coupled, distributed monolith

7.3.1 Essential characteristic #1: Services are independently deployable

This section explains what makes a microservice independently deployable and why that enables faster, safer releases with less cross-team coordination.

Key terms: component, deployable unit, deployment pipeline, tested in isolation, production-ready, test doubles, API, consumer-driven contract tests, contract, design-time coupling

7.3.2 Essential characteristic #2: Services are loosely coupled

This section explains why loosely coupled services are essential to a microservice architecture and how four kinds of coupling affect services differently.

Key terms: design-time coupling, lock step changes, breaking change, modifiability, runtime coupling, latency, availability, subdomains, build-time coupling, independently deployable components

7.4 Benefits of the microservice architecture

Introduces fast flow as the microservice architecture’s most important benefit and previews other benefits discussed later.

7.4.1 Enables fast, sustainable flow

The section explains how microservices enable fast, sustainable flow through modifiability, evolvability, testability, deployability, and observability.

Key terms: modifiability, loose design-time coupling, dependencies between services, evolvability, multi-component architecture, technology stack, testability, testable in isolation, fast-running automated tests, deployment pipeline

7.4.2 Supports multiple technology stacks

This section explains how microservices let teams choose suitable technology stacks while keeping those choices governed and making new technologies safer to try.

Key terms: technology stack, right tool for the right job, approved technologies, new technology stack, proven technology stack

7.4.3 Enables an organization to scale

Explains why service ownership and separate deployment pipelines let an organization grow without slowing software delivery.

Key terms: fast flow, deployment pipeline, design-time coupling, sustainable scale, services, build architecture

7.4.4 Improves the developer experience

This section explains how working on a small, mostly independent service improves developers’ focus, feedback, and productivity.

Key terms: developer experience, cognitive load, feedback, flow, distributed operations

7.4.5 Enables segregation of subdomains by characteristics

This section explains how separating subdomains into services according to their differing characteristics can improve resource use, development practices, availability, security, and focus on core business logic.

Key terms: subdomain, service instance, resource requirements, independently, domain-specific software development regulations, regulated subdomains, DevOps practices, business criticality, availability, resource contention

7.5 Drawbacks of the microservice architecture

Introduces the microservice architecture’s central tradeoff: the distributed structure that enables its benefits also brings significant drawbacks.

Key terms: distributed architecture, loosely coupled, independently deployable services, drawbacks

7.5.1 Distributed operations are complicated

This section explains why operations that span microservices are harder to design than local operations, focusing on network costs, runtime coupling, and transaction management.

Key terms: distributed operation, local system operation, process and transaction boundaries, network communication, latency, Service Level Objective (SLO), team autonomy, runtime coupling, service boundaries, SLOs

7.5.2 Implementing changes that span services is complicated

This section explains why microservices make changes within one service easier but require careful coordination when a change spans services.

Key terms: independently deployable, cross-service changes, service boundaries, subdomains, backwards compatible change, ordering dependency, reserveCredit(), availableCredit, breaking change, API version

7.5.3 Designing a good microservice architecture is challenging

This section explains why service boundaries make microservice design consequential, how poor boundaries can create a distributed monolith, and why design alternatives require careful trade-off analysis.

Key terms: process and transaction boundaries, subdomains, system operation, distributed monolith, design-time coupled, runtime coupled, design alternatives, new subdomain, trade-offs

7.5.4 Operational challenges

This subsection explains why microservices are harder to operate than a monolith and how tools help without eliminating that difficulty.

Key terms: runtime architecture, emergent behavior, container technologies, orchestration platforms, observability tools

7.5.5 Embracing independent deployability is a significant change

The section explains why application-wide acceptance tests undermine independent service deployment and how service-level tests provide an alternative.

Key terms: application-level user acceptance tests, independent deployability, distributed monolith antipattern, service-level user acceptance tests, white box tests, Order Service, createOrder(), reserveCredit()

7.5.6 Refactoring a monolith to microservice architecture is challenging

The section explains why organizations often move from a monolith to microservices only after outgrowing it, and why that migration is difficult despite its potential benefits.

Key terms: greenfield applications, monolithic architecture, microservice architecture, migrating a monolith, legacy code, microservices-based architecture

7.6 An overview of the microservice architecture pattern language

This section explains why patterns help developers make deliberate design decisions in a complex microservice architecture.

Key terms: deliberative design process, patterns, context, evaluation criteria, candidate solutions

7.6.1 Patterns and pattern languages

Defines patterns and pattern languages, then explains how a pattern’s forces, consequences, and relationships help guide architectural decisions.

Key terms: pattern, context, software pattern, forces, resulting context, benefits, drawbacks, issues, related patterns, predecessor

7.6.2 Overview of the microservice architecture pattern language

This section maps the microservice architecture pattern language to the problems it helps solve, from choosing an architecture to collaborating, communicating, testing, deploying, and operating services.

Key terms: pattern language, application architecture patterns, infrastructure patterns, application infrastructure patterns, application patterns, distributed operation, Saga, Command-side replica, API Composition, CQRS

7.7 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 6: The monolithic architecture Chapter 8: Interprocess communication in a microservice architecture →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.