Software Design
Distributed Systems
SAGA Pattern

Saga in Microservices

Saga is a design pattern in microservices used to manage distributed transactions without relying on ACID transactions.

It breaks a large operation into local steps.
If a step fails, compensating actions are executed to undo the previous steps.

Types of Saga

1. Choreographed (Most used)

Each service reacts to events independently, without a central coordinator.

2. Orchestrated

A central service coordinates the saga steps, instructing each service what action to perform.

⚠️

Orchestration is less used because it requires a central coordinator that can cause bottle necks.