Saga Pattern
distributedDistributed transactions as a sequence of local transactions
Type: patternPrinciples
Sequence of local transactionsEach step has compensationOrchestration or ChoreographyEventual consistency
When to use
Transactions spanning services, microservices with their own DBs
When not to use
Simple transactions, monoliths
Pros and Cons
Ventajas
- + Distributed transactions without 2PC
- + Services remain decoupled
- + Each service has its own DB
Desventajas
- - Compensation complexity
- - Complex debugging
- - Eventual consistency