Back to Catalog
Cloud
azure
Saga
Manage data consistency across microservices in distributed transaction scenarios
Intent & Description
The Saga pattern manages data consistency across microservices in distributed transaction scenarios. Instead of using a single distributed transaction, a saga is a sequence of local transactions where each local transaction updates data within a single service. If a step fails, compensating transactions undo previous steps.
Real-world Use Case
Use when implementing distributed transactions across microservices that require eventual consistency.
Source
Advantages
- Handles distributed consistency without two-phase commit
- Works across different data stores
- Enables eventual consistency
- Suitable for long-running transactions
Disadvantages
- Complex to implement compensating logic
- No strong consistency guarantees
- Can be difficult to debug