Definition: A Saga breaks a distributed business transaction into multiple local transactions, with each service committing its own database transaction.
In orchestration, a central Saga Orchestrator tells each service what to do and triggers compensating actions when something fails.
Example flow
Order Service
↓
Saga Orchestrator
↓
Payment Service
↓
Inventory Service
↓
Shipping Service
If Shipping fails:
Shipping ❌
↓
Orchestrator
↓
Cancel Inventory
↓
Refund Payment
↓
Cancel Order
Examples:
- Online shop: Order → Payment → Inventory → Shipping.
- Travel booking: Flight → Hotel → Car rental.
- Food delivery: Order → Restaurant → Payment → Driver assignment.