Saga coordination logic selects and invokes participants in sequence, passes them request data and results from earlier steps, and runs compensating transactions in reverse order when a local transaction fails. section 9.2.3
Key design decisions include:
- How a system command initiates the saga, and when a synchronous request receives its response. section 9.2.3
- Whether steps run sequentially or in parallel, and how timeouts are handled. section 9.2.3
Create Order Saga
The reserveCredit() operation needs customerID from the original request and orderTotal calculated by the Order Service. Coordination logic passes both values to the participant. section 9.2.3
Figure 9.5 There are two options for sending the response that make different trade-offs between the completeness of the response and minimizing runtime coupling. The first option, which suffers from runtime coupling, waits until the saga has finished and sends a complete response. The second option sends back a partial response. While this option avoids runtime coupling, the client needs an additional mechanism to determine the final outcome.
Compare waiting for saga completion to return a complete response with returning a partial response and requiring another way to learn the final outcome. section 9.2.3
