liveBook · Manning

Partial outcome

As explained in Microservices Patterns, Second Edition

A partial outcome is a result that reports acceptance or intermediate progress before the complete processing outcome is known.

A partial outcome tells a client that an operation has been accepted or has made initial progress before the complete result is known. Returning it early can reduce runtime coupling to downstream services and improve availability, but leaves the client responsible for discovering the final outcome. section 9.2.3 section 8.3.9

Choose the response point to match the operation:

  • For a cancellation request, return HTTP 202 Accepted as soon as the request is received; this does not indicate that validation has occurred. section 9.2.3
  • When creating an entity, return HTTP 201 Created with its ID after the step that creates it; this can reflect initial validation. section 9.2.3
  • Let the client learn the final result by polling a status endpoint or subscribing to notifications or events. section 9.2.3 section 8.3.9

A complete response avoids this follow-up burden but waits for the operation to finish, coupling the response to participating services. Prefer a partial outcome when reduced runtime coupling and resilience outweigh the added client complexity. section 9.2.3 section 8.3.9

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.
when to send the response end

Compare a response sent after saga completion with one sent earlier: the earlier response reduces runtime coupling but requires a way to discover the final result. section 9.2.3

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains response timing, HTTP status choices, and client follow-up, but not their implementation.
Examples
Uses order cancellation, order creation with an ID, and asynchronous order validation as examples.
What you can do after
Evaluate response designs by weighing runtime coupling and resilience against client complexity.
How it connects
Connects saga coordination with asynchronous messaging, runtime coupling, polling, and event notifications.

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.