liveBook · Manning

Chapter 11: Synchronous boundaries: Anti-corruption layers and distributed read models

What you will learn in chapter 11 of Clean Applications with Hexagonal Architecture

This introduction frames the model, availability, and data-ownership challenges of synchronous calls between bounded contexts.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction frames the model, availability, and data-ownership challenges of synchronous calls between bounded contexts.

Key terms: bounded context, model, invariants, domain, anti-corruption layer, outbound adapter, synchronous call, model boundary, read strategy, replica

11.1 Two hexagons, one call

This section describes synchronous calls between WriteFlow and neighboring contexts, their boundary contracts, and the risks of coupling models, availability, and transactions.

Key terms: driving actor, driven actor, input adapter, output port, outbound adapter, published API, read-only contract, output adapter, port DTO, exit plan

11.2 The anti-corruption layer

This section explains how an anti-corruption layer translates foreign models and protects a consuming domain at synchronous boundaries.

Key terms: anti-corruption layer, adapter, domain, business rules, consumer, outbound adapter, input adapter, foreign model, API contract, foreign schema

11.3 Inbound: When the CMS calls WriteFlow

The section explains how a CMS calls WriteFlow using WriteFlow’s own contract while each system handles its side of the translation.

Key terms: anti-corruption layer, input adapter, request contract, use case input, SendArticleBackForReviewCommand, contract, vocabulary, external post reference, domain concept, correlation

11.4 Outbound: Translating into the neighbor's model

This section explains how WriteFlow translates an author service’s responses and failures at its outbound boundary and keeps foreign models out of its use cases.

Key terms: output port, outbound adapter, DTO, validateAuthor(authorId), anti-corruption layer, AuthorNotFound, DependencyUnavailable, Error, boundary, contract

11.5 Bounding the availability cost

This section explains how WriteFlow bounds synchronous dependency delays and failures without relaxing domain rules.

Key terms: timeout, end-to-end deadline, outbound adapter, transient failures, author validation, idempotency, deduplication, retry window, operation-specific status check, circuit breaker

11.6 Reading data another context owns

This section compares ways for WriteFlow to read author data owned by another context while preserving ownership and accounting for freshness, availability, and local-copy costs.

Key terms: author service, output port, read API, availability and latency coupling, replica, published contract, read model, rebuild, reconcile, projected view

11.7 Choosing a read strategy

This section explains how to choose and encapsulate a per-query read strategy while preserving source authority and domain rules.

Key terms: source context, current value, latency, availability coupling, local copy, replica, projection, response-time target, update processing, lag

11.8 The rules that hold at a synchronous boundary

This section summarizes ownership, translation, and read-model rules at WriteFlow’s synchronous boundaries.

Key terms: domain, application layer, outbound adapter, output port, port’s DTO, input adapter, command, query, replica, projected view

11.9 Summary

Concepts explained in this chapter

← Chapter 10: When hexagons talk: Integration modes and the external 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.