chapter eleven

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

 

This chapter covers

  • Calling another hexagon through its published contract, not its database
  • Translating a neighbor's model with an anti-corruption layer
  • Keeping foreign concepts out of your commands, queries, and domain
  • Knowing which side owns the translation
  • Mapping the neighbor’s responses and failures into our model
  • Bounding the availability cost of a synchronous call
  • Answering a query that needs data another context owns
  • Choosing a read strategy from its freshness and ownership needs

Before an approval goes through, WriteFlow asks the identity service to validate an author. This is the chapter’s running interaction: WriteFlow calls a neighbor and must translate the answer it receives. In the same article-review context, the partner CMS asks WriteFlow to reopen an article for review. That inbound call is separate from author validation; it shows the other direction across the boundary.

11.1 Two hexagons, one call

11.2 The anti-corruption layer

11.3 Inbound: When the CMS calls WriteFlow

11.4 Outbound: Translating into the neighbor's model

11.5 Bounding the availability cost

11.6 Reading data another context owns

11.7 Choosing a read strategy

11.8 The rules that hold at a synchronous boundary

11.9 Summary