Cohesive Systems logoCOHESIVE SYSTEMS

Sagas and Process Managers

Sagas and process managers address the problem of coordinating long-running, multi-step work across boundaries where one atomic transaction is unavailable or inappropriate.

Cohesive Formulation

The sagas practice is about processes, coordination, and sometimes durable execution:

  • A process has identity, state, progress, and recovery behavior.
  • It observes events or signals.
  • It emits commands to participants.
  • It may compensate, retry, time out, or escalate.

Sagas and process managers can be implemented without a workflow engine, but they still need explicit persistence, recovery, idempotency, and delivery semantics when they are expected to survive failure or long delays.

In the Model

A saga can be modeled as an entity-observer: it has state and history, observes events, interprets them relative to a process boundary, and emits commands or endogenous process events.

In a weak isolation context, compensating actions are asynchronous and eventual. A compensation is not an inverse database update that restores a globally isolated past. It is a new command, transition, or process step whose effect may arrive later, fail, retry, be observed by other participants, and require its own idempotency, ordering, and recovery semantics.

ARIES is useful as a contrast point. A database transaction log can support undo, redo, and partial rollback inside one storage engine's transaction boundary. Its Compensation Log Records record undo actions so recovery can repeat history safely and avoid undoing the same action twice. A saga log or process history supports recovery across multiple boundaries, but its compensating steps are semantic forward actions, not storage-engine undo records or ARIES-style Compensation Log Records.

Failure Modes

The pattern fails when the process boundary is implicit, when compensation is assumed to be inverse transition, or when delivery and idempotency are ignored. Sagas do not remove consistency problems; they make consistency procedural and temporal.

External References

Related concepts: processes, coordination, weak isolation patterns, weak isolation patterns as architecture practice, ACID, write-ahead logging, durable execution, observer, entity, command, event, idempotency, ordering, retry, recovery, workflow engines, durable execution engines, trace and feedback.