A distributed transaction is the act of updating the state of two or more distinct systems simultaneously. These distinct systems could be databases, [[Microservices MOC|Microservices]], or external SaaS systems.
This transaction should be atomic, meaning that if only some of the systems can be updated but one system update fails, then the updates to the other systems must be rolled back.
Implementing distributed transactions can be a complex both in terms of upfront effort and ongoing maintenance (see [[Distributed sagas]]). Therefore, in general it's preferable to design system integrations so that they can be avoided as far as possible.
- [Distributed transaction (wiki)](https://en.wikipedia.org/wiki/Distributed_transaction)