Sagas provides a structured way to deal with them.
Distributed transactions add significant complexity to systems.
They have problematic failure modes; they may not always deliver the expected results even when they work.
There are two styles of sagas to consider: orchestrated and choreographed.
Orchestrated Sagas
A central orchestrator coordinates the sequence of events by calling the microservices involved in the saga.
Pros
  • Simplicity and clarity in the process flow.
Cons
-The orchestrator becomes a single point of failure. -The orchestrator becomes a bottleneck when many teams work on the same business process.
Choreographed Sagas
With choreographed sagas, there is no central coordinator. Microservices react to events published by other services to continue the process.
Pros
  • Reduced coupling -Better scalability across teams.
Cons
  • Increased complexity in guaranteeing the correct sequence of events and handling compensations. -I have worked more with choreographed sagas.
Orchestrated sagas work fine when a single team handles the whole process. But, they become more problematic with many teams.
Choreographed sagas work better when many teams need to work together.