Stack Explorer

Saga Pattern

distributed

Distributed transactions as a sequence of local transactions

Type: pattern

Principles

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

Related Technologies

Related Patterns