Please enable JavaScript.
Coggle requires JavaScript to display documents.
SAGA pattern - Coggle Diagram
SAGA pattern
Coordinating saga
Choreography
(Event style)
Pros
no strong dependency on a central component, so no single point of failure
ideal for transations involving few actors
Cons
not suitable for managing complex processes
don't have an "status/overview" of the saga
difficult to manage the flow when the number of services involved increases
Orchestration
(Command style)
Pros
have a central point to see the status/overview of the sage
easily manage and modify
add new step: easier and simpler to implement
easier rollback
Cons
single point of failure
complex in case using Outbox Pattern to ensure atomicity
Approach
One Microservice playing the role of Orchestrator + Outbox Pattern to ensure atomic operations
BPM ex Temporal/Camunda playing the role of Orchestrator
Communication - async via message broker
Event
Asynchronous request/response
How saga participants atomically update the database and send a message?
Transactional Outbox pattern
publish a message by inserting it into an OUTBOX table as part of the database transaction
Event Sourcing pattern
uses events to persist domain objects and thereby combines updating the database and publishing events into a single, inherently atomic operation