Distributed transaction
Published Updated
What is Distributed transaction?
A coordinated unit of work that changes data across multiple systems and aims to keep those changes consistent.
For example, checkout may need both a payment record and a stock reservation in separate databases. A traditional atomic distributed transaction coordinates participants so all commit, meaning save permanently, or all abort. This requires compatible systems and can block during failures. External payment APIs often cannot join that protocol, so consider a saga for such workflows.
When you would use it
Use it when changes across systems must stay consistent and you have checked which coordination guarantees those systems support.
Common operations
- Identify all participating systems and guarantees.
- Plan recovery when a participant cannot finish.