Complexity has always been a thing
In distributed computing, ensuring consistency across multiple systems is a challenging task, especially when transactions involve multiple services.
When the services involved in your business logic were in a single piece of code, the easy way to solve this kind of problem was to use an atomic transaction. This left the hard part to the database, which was to guarantee data consistency at the end of the process.
With the introduction of the Simple Object Access Protocol (SOAP), distributed services, and databases, this pattern wasn’t valid, and another pattern became the standard, the two-phase commit (2PC).
2PC
This pattern is a widely used distributed algorithm designed to achieve atomicity in transactions that span multiple nodes. When multiple nodes participate in a transaction, there is always a risk that one node may fail, leading to an inconsistent state. The 2PC protocol ensures that all nodes commit a transaction...