Skip to catalogue

107

saga

A multi-step business action with a compensating step for each. Not a distributed transaction you hoped would exist.

What is saga?

A saga is a sequence of local transactions across services. Each step has an undo. If step three fails, you run the undos for two and one. There is no global lock. The user can observe the in-between states.

Why does saga matter when vibe coding?

Models wrap “charge, reserve stock, email” in one fictional transaction across three APIs. The second call fails and the charge remains. Name the saga and the compensation.

How do you do saga?

Write the steps and the undo for each. Persist which step you are on. Retries must be idempotent. If an undo can fail, that is an operator alert, not a log line.

How do you ask a model for saga?

Implement (flow) as a saga, not one transaction across services. Each step has a compensation. Persist progress. Retries are idempotent. If compensation fails, surface it. Do not pretend two APIs share a commit.

What goes wrong with saga?

A saga with no undo for the payment step. You automated the forward path and left refunds as a ticket queue.

adjacent