liveBook · Manning

Chapter 4: The importance of loose coupling

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

Introduces loose coupling, defines when software elements are coupled, and explains why different forms of coupling matter to change speed and runtime behavior.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces loose coupling, defines when software elements are coupled, and explains why different forms of coupling matter to change speed and runtime behavior.

Key terms: coupling, loose coupling, tight coupling, availability, ease of change, design-time coupling, build-time coupling, runtime coupling, infrastructure coupling, fast flow

4.1 Introduction to coupling

Defines coupling in terms of influence between software elements and explains why loose coupling is desirable.

Key terms: coupling, loose coupling, tight coupling, software elements

4.1.1 Four flavors of coupling

The section defines four types of coupling and distinguishes their development-time and runtime effects.

Key terms: design-time coupling, build-time coupling, runtime coupling, infrastructure coupling, development-time characteristics, runtime behavior

4.1.2 Why loose coupling matters

This section explains why loose design-time and build-time coupling support fast flow, while runtime and infrastructure coupling affect an application’s behavior in production.

Key terms: design-time coupling, build-time coupling, fast flow, deployment pipeline, runtime coupling, infrastructure coupling, availability, latency

4.2 Design-time coupling

This section introduces loose design-time coupling as a reason microservices support fast flow and identifies where that coupling matters.

Key terms: design-time coupling, component view, domain view, fast flow

4.2.1 Design-time coupling and cohesion

This section explains how loose design-time coupling and cohesion organize software elements so changes remain localized and easier to make.

Key terms: design-time coupling, loose design-time coupling, subdomain, cohesion, child elements, parent element, LineItems, MenuItems, localized changes, independently and in parallel

4.2.2 Benefits of loose design-time coupling

This section explains how loose design-time coupling localizes changes, increases team autonomy, and supports business success.

Key terms: loose design-time coupling, cohesion, localized change, team autonomy, coordination, business success, high performing organizations

4.2.3 Loose design-time coupling enables organizations to scale

This section explains how design-time coupling affects communication overhead and an organization’s ability to grow without slowing delivery.

Key terms: design-time coupling, communication overhead, loosely coupled architecture, tightly design-time coupled architecture, Fred Brooks, Accelerate, deployments per day per developer

4.2.4 Designing loosely design-time coupled software

The section explains design choices that reduce design-time coupling by keeping APIs stable, avoiding harmful duplication, and limiting what software elements expose and depend on.

Key terms: design-time coupling, API, implementation details, monolith-first approach, DRY, Don’t Repeat Yourself, OrderTotalCalculator, order total, shared library, team autonomy

4.3 Build-time coupling

This section defines build-time coupling between build subprojects and explains how it lengthens the wait for build and test feedback.

Key terms: build-time coupling, build project, build subproject, recompiled and retested, design-time coupling, feedback

4.3.1 About build-time coupling in Gradle projects

This section explains how dependencies between Gradle subprojects determine which projects an incremental build recompiles and retests after a change.

Key terms: Gradle build project, subprojects, incremental builds, build-time coupling, Money, Customer, implementation dependency, api dependency, transitive dependency

4.3.2 A project should only be build-time coupled to stable projects

This section shows how separating a subdomain’s stable API from its frequently changing implementation reduces build-time coupling and speeds builds.

Key terms: build-time coupling, API subproject, implementation subproject, CustomerService

4.3.3 Reducing build-time coupling within a Gradle subproject

The section shows how splitting a Gradle subproject along dependency boundaries can avoid unnecessary test runs, especially in a large monolith.

Key terms: build-time coupling, Gradle subproject, web, persistence, domain

4.4 Runtime coupling

The section defines runtime coupling and explains why a service’s dependence on another service’s response can make a distributed operation unavailable.

Key terms: runtime coupling, design-time coupling, build-time coupling, availability

4.4.1 An example of tight runtime coupling

The Order Service example shows how waiting for another service at runtime reduces endpoint availability and increases response time.

Key terms: runtime coupled, Order Service, Customer Service, POST /orders, PUT /customers/{id}, availability, long chains, latency, response time, tight runtime coupling

4.4.2 Siloed organization can lead to tight runtime coupling

Shows how a siloed view of a request can hide tight runtime coupling and put an SLA at risk.

Key terms: tight runtime coupling, end-to-end flow of requests, SLA

4.4.3 Minimizing runtime coupling

This section explains three ways to reduce an operation’s runtime coupling and the trade-offs each introduces.

Key terms: runtime coupling, subdomains, Order Service, createOrder(), available credit, Customer Service, subdomain, asynchronous messaging, POST /orders, partial outcome

4.5 Infrastructure coupling

This section defines infrastructure coupling and explains why sharing infrastructure can affect components’ runtime behavior even when they do not communicate.

Key terms: infrastructure coupling, runtime behavior, infrastructure, highly available components

4.5.1 An example of infrastructure coupling

Uses two services sharing infrastructure to show how infrastructure coupling can let one service affect another.

Key terms: infrastructure coupling, shared infrastructure, Customer Service, Order Service

4.5.2 Two types of infrastructure coupling

This section explains two ways services can be coupled through shared infrastructure: competing for resources and being affected by each other’s configuration changes.

Key terms: competition for resources, Kubernetes, CPU and memory resources, network bandwidth, database resources, database lock, configuration changes with unintended consequences, Kubernetes cluster, database server

4.5.3 Minimizing infrastructure coupling

This section explains how runtime decoupling and separate infrastructure can improve the availability of critical services.

Key terms: infrastructure coupling, runtime decoupled, critical services, separate infrastructure, Order Service, runtime coupling, design-time coupling, build-time coupling

4.6 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 3: Software architecture: what is it, why does it matter and who does it? Chapter 5: Architectural requirements for fast flow →

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.