Skip to content
Latchkey

What Is the Saga Pattern?

The saga pattern breaks a multi-service operation into a chain of local transactions, each committing in its own service and publishing an event that triggers the next step. If a later step fails, previously completed steps run compensating transactions to undo their effects. It provides consistency without holding distributed locks.

Why it matters

Sagas let microservices coordinate without the blocking cost of two-phase commit, at the price of designing explicit compensation logic. They are the common answer to consistency across service boundaries.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →