Orchestration
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
coordinate a saga with an explicit orchestrator.
Planned topics
- An orchestrator owns the process: sends commands, waits for replies, decides the next step.
- The flow is in one place: easier to read, test, add timeouts, and monitor.
- Cost: an extra component and the risk of putting business rules in it; keep it about sequencing only.
- Persist the saga state so a restart resumes where it stopped.
- Rule of thumb: choreography for short, stable flows; orchestration for longer, branching, or time-sensitive ones.
Draft outline details
Demonstration
enum SagaState { STARTED, STOCK_RESERVED, PAID, COMPLETED, COMPENSATING, FAILED }
record OrderSaga(UUID orderId, SagaState state, Instant deadline, int version) {}Check your understanding
Why persist saga state?
Show answer
So a crash or restart resumes the process instead of losing it.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.