A distributed ACID transaction coordinates multiple services and their resource managers under one global transaction, extending ACID consistency across service boundaries. XA is the de facto standard for managing these transactions. section 9.1.2
An XA-based implementation requires coordinated participation:
- Use XA-compliant databases or message brokers, with drivers and APIs that can join a global transaction. section 9.1.2
- Propagate a global transaction identifier to participants. A transaction coordinator uses two-phase commit: participants vote during preparation, then commit or roll back. section 9.1.2
- In microservices, prefer local ACID transactions coordinated through a Saga; classic distributed transactions add complexity and runtime coupling. section 9.1 section 9.4
Creating an order
A createOrder command spanning the Order Service and Customer Service would require both services and their database servers to participate in the same transaction. section 9.1.2
Figure 9.1 A hypothetical implementation of XA/2PC in a microservice architecture. The services register as participants with the Transaction Coordinator. They enlist their databases in the distributed transaction. The Transaction Coordinator commits the transaction in two phases. In the prepare phases, participants vote on whether they can commit. In the commit phase, the transaction coordinator instructs all participants to either commit or roll back based on the collected votes.
The diagram traces service enlistment and the coordinator’s prepare-and-commit flow. section 9.1.2




