SYSTEM-DESIGN Contents

Saga Pattern

Manage distributed transactions with orchestration or choreography.

On this page

Saga Coordinates Distributed Transactions

When a workflow spans services, a single ACID transaction is impossible. Saga coordinates steps with compensating actions.

Two Models

  • Orchestration (central coordinator)
  • Choreography (event-driven reactions)

Production Risks

  • Partial failure complexity
  • Compensation logic errors

Production-First Takeaway

Use Saga when cross-service consistency is required. Design compensations carefully and test failure paths.