liveBook · Manning

Runtime coupling

As explained in Microservices Patterns, Second Edition

A strong runtime dependency in which one component's failure or unavailability prevents another from completing its operation.

Runtime coupling occurs when one component’s failure causes another component to fail. For example, a service is runtime coupled to another when it cannot complete a request until the other service responds. The operation’s availability then depends on both services. section 4.4

Synchronous calls across service boundaries can reduce availability and increase latency. Long chains amplify the risk: a failure in one service can cause the entire request to fail. Runtime coupling differs from design-time and build-time coupling, which affect development, and infrastructure coupling, which arises from shared resources. section 1.3.4 section 4.1.1

Creating an order

The Order Service handles POST /orders by calling the Customer Service to validate the customer and reserve credit. It cannot respond until the Customer Service responds. If each service is 99.9% available, the example endpoint is approximately 99.8% available; its response time also includes both services’ response times. section 4.4.1

Figure 4.12 The Order Service cannot respond to the POST /orders request until the Customer Service has responded to the PUT /customers/{id} request. As a result, the availability of the POST /orders request is the product of the availability of the Order Service and the Customer Service
runtime coupling

Follow the synchronous request path and its availability dependency. section 4.4.1

Trace requests end to end, including calls owned by other teams. A request that appears to depend on only a few services may depend on a larger cluster behind them, putting its availability target at risk. section 4.4.2

Choose a way to reduce coupling for the operation that matters:

  • Merge subdomains into one service so the operation is local. This suits frequent operations needing high availability and low latency, but can produce oversized services or a monolith. section 4.4.3
  • Move responsibilities between services. Moving credit management to the Order Service removes its credit-validation call, but makes customer creation span two services. section 4.4.3
  • Use asynchronous messaging. The Order Service can send a validation message and return an HTTP response immediately; a later response lets it approve or reject the order. section 4.4.3

Minimize coupling where its operational cost matters, rather than eliminating it at any price. Some coupling is inevitable, and reducing it can shift complexity or dependencies to other operations. section 4.6 section 4.4.3

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains runtime coupling through availability and latency effects, a request-flow example, and three mitigation strategies with trade-offs.
Examples
Illustrates runtime coupling with order creation and a cross-team request that depends on a hidden service cluster.
What you can do after
Diagnose runtime coupling by tracing end-to-end requests, then evaluate service consolidation, responsibility reassignment, and asynchronous messaging.
How it connects
Connects runtime coupling to synchronous communication, asynchronous messaging, service boundaries, and infrastructure coupling.

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.