A service query is an API operation that a provider service exposes for retrieving data needed by a query composed across services. An API composer calls these operations and combines their results into the response expected by the client. section 12.2.1
Design service queries and their composition by deciding:
- Which services to call, what data to request, and the order of calls. section 12.3.2
- How to merge results while balancing remote calls, response size, and latency. section 12.3.2
- How to handle inconsistent results, such as a cancelled Order paired with a Ticket not yet cancelled. section 12.3.2
Order status
A composer may retrieve an Order from the Order Service and a Ticket from the Kitchen Service. If the Order is CANCELLED but the Ticket is not, the composition logic should resolve the mismatch before returning the response. section 12.3.2
Figure 12.5 The API composition pattern consists of an API composer and two or more provider services. The API composer implements a query by querying the providers via their APIs and combining the results.
Shows an API composer querying provider services and combining their results. section 12.2.1
