Try
↑ ↓ move↵ openesc close
In this lesson · topic 7 of 7
  1. 1. An order that spans four services
  2. 2. Steps, undos and the reverse order
  3. 3. Fail steps and watch readers see the middle
  4. 4. Atomic in the end, visible in the middle
  5. 5. One conductor or a chain of events
  6. 6. When the undo cannot be done
  7. 7. Compensation, isolation and coordination

Topic 7

Compensation, isolation and coordination

3 min read

Predict first

Why is a compensating action not a rollback?

Predict first

Which property does a saga not give by itself?

Predict first

A saga step is delivered twice. What keeps it from running twice?

Take away

  • A saga splits a transaction into local steps, each with a compensating action.
  • On a failure the finished steps are undone in reverse order.
  • A compensation is a new change. Some actions cannot be undone, so put them last.
  • Sagas are atomic in the end and not isolated. Readers can see the middle, and a semantic lock or other design fixes it at a cost.
  • Orchestration puts the flow in one place and costs messages. Choreography has none to spare and is hard to trace.
  • Every step and compensation must be idempotent, and a stuck compensation needs a limit and a person.

Sources

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms