liveBook · Manning

Compensating transaction

Also called compensation, compensating action

An operation that counteracts or semantically reverses the effects of an earlier operation when directly undoing it is unavailable or unsuitable.

How 3 Manning books explain it

Microservices Patterns, Second Edition

A transaction that semantically undoes the effects of a previously committed transaction.

How it is used
Handles business-rule failures after earlier saga steps have committed local updates.
How deep it goes
Defines when compensation is needed and explains its complexity, isolation concerns, and transaction-boundary alternatives.
Examples
Uses order creation, credit reservation, and order rejection to illustrate compensation after a business-rule violation.
What you can do after
Evaluate when saga steps need compensation and when different transaction boundaries can avoid it.

Read how Microservices Patterns, Second Edition explains compensating transaction →

Grokking Software Architecture

A transaction that applies a corrective action to counteract the effects of an earlier completed transaction.

How it is used
Uses compensation to correct committed work in distributed workflows and recover from inconsistent writes during network partitions.
How deep it goes
Explains the failure-and-correction sequence and its rationale, without providing an implementation.
Examples
Illustrates compensation with inventory restored after billing fails and discusses correction after a network partition.
What you can do after
Evaluate/understand when committed work needs explicit correction rather than a shared rollback.

Read how Grokking Software Architecture explains compensating transaction →

Architecting for Autonomy

A separately designed operation that offsets or repairs the effects of an action that cannot be directly undone.

How it is used
Handles recovery when a later step in a multi-system flow fails after earlier actions have changed state.
How deep it goes
Defines predefined, deterministic recovery and rejects agent-improvised undo calls, but does not specify individual recovery procedures.
Examples
Contrasts separately designed recovery for completed actions with Citi's court-mediated recovery after a mistaken payment.
What you can do after
Evaluate/understand recovery paths by checking whether completed actions have designed recovery rather than improvised undo.

Read how Architecting for Autonomy explains compensating transaction →

Also covered in

What to know first

Related concepts

Questions about compensating transaction

What is compensating transaction?

An operation that counteracts or semantically reverses the effects of an earlier operation when directly undoing it is unavailable or unsuitable.

Which Manning books explain compensating transaction?

Microservices Patterns, Second Edition, Grokking Software Architecture and Architecting for Autonomy.

What should I know before learning compensating transaction?

Manning books that teach compensating transaction usually introduce saga, ACID, consistency and agent orchestration first.

What is compensating transaction also called?

Compensating transaction is also called compensation or compensating action.

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.