Distributed Transactions and why you should avoid them
- Modern technologies won't support it (RabbitMQ, Kafka, etc.);
- This is a form of using Inter-Process Communication in a synchronized way and this reduces availability;
- All participants of the distributed transaction need to be avaiable for a distributed commit, again: reduces availability.
Implementing business transactions that span multiple services is not straightforward. Distributed transactions are best avoided because of the CAP theorem. Moreover, many modern (NoSQL) databases don’t support them. The best solution is to use the Saga Pattern.