Microservices · Oct 2026 · 5 min read · 03/05
Distributed transactions: 2PC vs Saga
How do you handle a transaction that spans multiple databases? Two-phase commit, choreographed sagas and orchestrated sagas compared.

One problem shows up again and again once you move from monolith to microservices: how do you handle a transaction that spans multiple databases?
I've hit this twice: once building a ride-hailing platform, and again working on a management system for a Sri Lankan government authority made up of multiple interconnected microservices.
Why it gets hard
In a monolith, ACID is easy: one database, one transaction, rollback on failure, done. In a distributed system, each service owns its own database, and there's no single transaction boundary to roll back. If service 3 of 5 fails, you can't just "undo". The first two already committed, in separate databases, with no shared lock.
There are two real approaches here.
Two-Phase Commit (2PC)
A central coordinator asks every service to "prepare", waits for all to confirm, then tells everyone to commit. It gives you strong consistency, but it comes at a cost. It holds locks across every participant while waiting on the coordinator's decision, which hurts availability, and if the coordinator goes down mid-transaction, everything stalls. Single point of failure, real problem.
The Saga pattern
Instead of one big distributed transaction, break it into a sequence of local transactions, each in its own service. If a step fails, you don't roll back the whole chain atomically. You run compensating transactions to undo the steps that already succeeded.
Sagas come in two flavors.
Choreography
No central coordinator. Each service publishes an event when its local transaction completes; other services listen and react, executing their own step or triggering a compensating action on failure. This is what I ended up building for the transaction-heavy flows in the government system.
Orchestration
A dedicated orchestrator service drives the sequence of steps explicitly. If it persists its state and runs as a stateless, horizontally replicable service, a crash isn't fatal: another instance just resumes from the last known step. Different failure profile than a 2PC coordinator.
Choosing your trade-off
2PC trades availability for consistency. Saga trades strict consistency for availability and resilience, and asks you to design for eventual consistency and compensation up front.
Distributed transactions aren't really "solved". You're choosing which guarantees to trade away.
Curious which pattern others have leaned on for large-scale or high-throughput systems: pure choreography, orchestration, or a hybrid of both?