Why it matters

Compensations shape reliability. Understanding shapes design.

Advertisement

The architecture

Define compensating action per step.

On failure: execute compensations reverse order.

Idempotent.

Compensation patternForward stepwith side effectCompensationreverse effectOn failurereverse order'Semantic undo' -- send apology email instead of unshipping physical package
Compensation.
Advertisement

How it works end to end

Semantic undo when exact impossible.

Idempotent design.

Compensation may fail too.