Saga
A saga is a distributed transaction pattern that coordinates a sequence of local transactions and uses compensating actions to address failures.
Microservices Patterns, Second Edition
A distributed transaction pattern that coordinates a sequence of local transactions and, when necessary, compensating actions across services.
- How it is used
- Implements system commands that update data across service transaction boundaries.
- How deep it goes
- Explains compensation, pivot-based step structure, coordination choices, isolation countermeasures, and response trade-offs.
- Examples
- Uses an order-creation flow with credit reservation, rejection, approval, and a semantic lock.
- What you can do after
- Evaluate and design distributed command flows using compensation, coordination choices, and isolation countermeasures.
Read how Microservices Patterns, Second Edition explains saga →
Grokking Software Architecture
A pattern that coordinates a distributed business transaction as a sequence of local transactions with compensating actions for failures.
- How it is used
- Maintains data consistency across independent service databases during long-running business processes.
- How deep it goes
- Defines local transactions and compensation, walks through a failure, and contrasts coordination styles without providing an implementation.
- Examples
- Uses an inventory deduction and failed credit-card charge to illustrate restoring a laptop through compensation.
- What you can do after
- Evaluate and understand how a saga handles a failed distributed business transaction and why reliable event publication matters.
gRPC Microservices in Go
A saga is a distributed transaction pattern that coordinates a sequence of local transactions and uses compensating transactions when a step fails.
- How it is used
- Coordinates local transactions to maintain consistency across service-owned data stores during order creation.
- How deep it goes
- Explains choreography, orchestration, client completion options, and reverse compensation through workflows rather than implementation code.
- Examples
- Traces an order through payment and shipping, including failure status changes, refunds, and cancellation.
- What you can do after
- Apply it via event channels or an orchestrator to coordinate order, payment, and shipping steps and compensate after failure.
Also covered in
- Clean Applications with Hexagonal ArchitectureIn early access (MEAP)
- Think Distributed Systems
What to know first
- ACIDACID is the set of database transaction properties—atomicity, consistency, isolation, and durability—that characterize reliable transactional behavior.
- consistencyConsistency is the degree to which related data, behavior, or results agree with one another and conform to applicable rules or expectations.
- distributed transactionA distributed transaction is a unit of work involving multiple independent resources or systems whose outcome is coordinated as a single transaction.
- availabilityAvailability is the degree or proportion of time that a system or service is operational and accessible when required.
Related concepts
- asynchronous requestuses · An asynchronous request is an interaction in which a requester sends a request without waiting for its processing to complete or for an immediate response.
- compensating transactionuses · An operation that counteracts or semantically reverses the effects of an earlier operation when directly undoing it is unavailable or unsuitable.
- consistencyaddresses · Consistency is the degree to which related data, behavior, or results agree with one another and conform to applicable rules or expectations.
- choreography-based sagaincludes · A choreography-based saga is a distributed transaction pattern in which participants perform local transactions and coordinate subsequent work through events, without a central orchestrator.
- pivot transactionhas part · A pivot transaction is a saga transaction after which the workflow must complete through forward recovery or subsequent noncompensatable actions.
- retriable transactionhas part · A retriable transaction is a transaction that can be attempted again after failure without violating the correctness of the overall workflow.
Questions about saga
What is saga?
A saga is a distributed transaction pattern that coordinates a sequence of local transactions and uses compensating actions to address failures.
Which Manning books explain saga?
Microservices Patterns, Second Edition, Grokking Software Architecture and gRPC Microservices in Go.
What should I know before learning saga?
Manning books that teach saga usually introduce ACID, consistency, distributed transaction and availability first.
What kinds of saga are there?
Kinds of saga include choreography-based saga.
What are the parts of saga?
Saga includes pivot transaction and retriable transaction.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


