Saga Pattern
A classic design pattern in distributed systems for handling long-running transactions, originating from a 1987 database paper by Hector Garcia-Molina. It decomposes a long transaction into a sequence of ordered local transactions, each accompanied by a compensating transaction, and supports both orchestration and choreography coordination styles.
Timeline (last 90 days)
A compensating transaction is the standard pattern in distributed systems for handling non-rollbackable operations, originating from the Saga pattern, which offsets the effects of each completed step by performing a semantically opposite operation.
The Saga pattern is a common solution for handling cross-service data consistency in distributed systems, breaking a long transaction into a series of local transactions equipped with compensating operations.
The Saga pattern has two common implementation styles: orchestration (directed by a central coordinator) and choreography (services triggering each other through events).
The Saga pattern breaks a large transaction into a series of local transactions T1…Tn, each Ti paired with a compensating transaction Ci; on failure, the compensation actions are executed in reverse order to return the whole to a consistent state.
The Saga pattern was first proposed by Hector Garcia-Molina and Kenneth Salem in 1987 to solve the problem that long transactions are difficult to keep atomic in distributed databases.
Saga's compensation is not a physical rollback and cannot restore side effects already consumed by external systems; it can only perform semantically equivalent reverse operations.
Compensating transactions are the core idea of the Saga pattern, undoing the side effects of non-rollback-able steps by executing logically inverse operations.
AgentWall provides a rollback hook mechanism that executes registered compensating actions in reverse order when a session fails, a design inspired by the Saga pattern.
The Saga pattern was proposed by Hector Garcia-Molina of Princeton University in 1987.
"Transactions" in agent systems often span multiple heterogeneous services (LLM APIs, tool calls, database writes), making traditional transaction models difficult to apply directly and requiring the introduction of distributed transaction solutions such as the Saga pattern.
All Facts (10)
A compensating transaction is the standard pattern in distributed systems for handling non-rollbackable operations, originating from the Saga pattern, which offsets the effects of each completed step by performing a semantically opposite operation.
50%UnverifiedThe Saga pattern is a common solution for handling cross-service data consistency in distributed systems, breaking a long transaction into a series of local transactions equipped with compensating operations.
50%UnverifiedThe Saga pattern has two common implementation styles: orchestration (directed by a central coordinator) and choreography (services triggering each other through events).
50%UnverifiedThe Saga pattern breaks a large transaction into a series of local transactions T1…Tn, each Ti paired with a compensating transaction Ci; on failure, the compensation actions are executed in reverse order to return the whole to a consistent state.
50%UnverifiedThe Saga pattern was first proposed by Hector Garcia-Molina and Kenneth Salem in 1987 to solve the problem that long transactions are difficult to keep atomic in distributed databases.
50%UnverifiedSaga's compensation is not a physical rollback and cannot restore side effects already consumed by external systems; it can only perform semantically equivalent reverse operations.
50%UnverifiedCompensating transactions are the core idea of the Saga pattern, undoing the side effects of non-rollback-able steps by executing logically inverse operations.
50%UnverifiedAgentWall provides a rollback hook mechanism that executes registered compensating actions in reverse order when a session fails, a design inspired by the Saga pattern.
50%UnverifiedThe Saga pattern was proposed by Hector Garcia-Molina of Princeton University in 1987.
50%Unverified"Transactions" in agent systems often span multiple heterogeneous services (LLM APIs, tool calls, database writes), making traditional transaction models difficult to apply directly and requiring the introduction of distributed transaction solutions such as the Saga pattern.
50%