The world has changed from a monolithic architecture to microservices. This change has brought flexibility, scalability, and many other benefits. Now business transactions can span multiple microservices or even 3rd party systems.
However, this change is not for free. CAP Theorem says that a distributed system can achieve only 2 of the following 3 requirements: Consistency, Availability, and Partitioning tolerance (CAP). In addition, when faced with the question of whether you want it right or you want it right now, humans usually want an answer right now rather than right. Which basically opens a world of eventually consistent systems.
In this presentation, I will explore the challenges of implementing distributed business transactions and show how we can use Sagas and State machines to orchestrate them. The presentation covers:
- Transactions in the Distributed world
- Orchestration of business transactions with help of Sagas
- Implementation of a simple orchestrator using Spring Statemachine