Glossary · System coordination, integration and orchestration
Compensating transaction
Also known as: compensation action, saga compensation
German: Kompensationstransaktion
In distributed systems, a compensating transaction is an operation that semantically undoes the effect of a previously completed step when a later step of a multi-step process fails, used where a single atomic transaction across all systems is not possible.
- System integration
In one sentence
A compensating transaction undoes the effect of an already completed step when a later step of a distributed process fails.
Example
If the MES reserves material in the ERP but the line then rejects the order, a compensating transaction releases the reservation instead of leaving the stock blocked.
How it applies
- Engineering: In the saga pattern, each step of a long-running process has a defined compensation. Compensations must themselves be retry-safe, because they may be executed more than once after failures (see Idempotency).
- Limits: Not every step can be undone. Material that has been cut, mixed or shipped cannot be “uncommitted”; the compensation may be a corrective business action such as a scrap booking or a return order.
- Documentation: Describe for each integration process which compensations exist, when they are triggered automatically and when a person must intervene. Operators need to know what the system has already reversed.
Compensating transaction vs. rollback
A database rollback discards changes that were never committed. A compensating transaction acts after a commit and creates a new, opposite change, so both the original step and its compensation stay visible in the history.