## Notes - Describes the situation where multiple async services need to be guaranteed executed in order Options are either - [[#Orchestration]] - [[#Choreography]] ## Orchestration **Orchestration** is using a single service to call services in the correct order and handle errors. ![[saga-orchestration.png]] ### Pros - Suitable when transactions require additional services or adding new services - Suitable when have control over every participant - Does not introduce cyclical dependencies because the *orchestrator* depends on the saga participants - Participants do not need to know about each other ### Cons - Orchestrator is a single-point of failure ### When to Use - When a centralized service is needed - Ease of managing code --- ## Choreography ![[saga-choreography.png]] - Does not use a central service - Is more event-driven ### Pros - Suitable for simple workflows that do not need complex coordination logic - Simple to implement because it doesn't require additional service implementation and maintenance - No single point of failure ### Cons - More difficult to debug - More difficult to test because multiple services are required - Risk of cyclical dependencies because services need to consume the result of other services ### Use Cases - Tight-coupling is not needed - Do not want to block other services - Rollback is required