What Is the Saga Pattern?
The saga pattern breaks a multi-service operation into a chain of local transactions, each committing in its own service and publishing an event that triggers the next step. If a later step fails, previously completed steps run compensating transactions to undo their effects. It provides consistency without holding distributed locks.
Why it matters
Sagas let microservices coordinate without the blocking cost of two-phase commit, at the price of designing explicit compensation logic. They are the common answer to consistency across service boundaries.
Related guides
What Is a Distributed Transaction?A distributed transaction spans multiple databases or services and must either commit everywhere or roll back…
What Is Two-Phase Commit?Two-phase commit is a protocol that coordinates a transaction across multiple systems by first asking all to…
What Is a Domain Event?A domain event is a record that something meaningful happened in the business domain, named in past tense and…