liveBook · Manning

Api composition service

As explained in Microservices Patterns, Second Edition

An API composition service is a service that contains the API composer responsible for implementing a system query.

An API composition service contains the API composer that implements a system query by calling provider services and combining their results. It is typically an API Gateway, a Backend-for-frontend (BFF), or a composition service. section 12.2.1

Assess whether API composition fits the query:

  • Consider how data is distributed and whether provider databases and APIs can efficiently support the required service queries. section 12.2.1
  • Avoid it when the composer would need an inefficient in-memory join of large datasets. section 12.2.1
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.
ApiCompositionBasedQueryBigPicture

The diagram shows the composer querying provider services and combining their results. section 12.2.1

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines the service's role and typical forms, while stopping short of implementation detail.
Examples
Uses findOrder() as an example of a system query for API composition.
What you can do after
Evaluate applicability by checking data distribution, provider capabilities, and the cost of in-memory joins.
How it connects
Connects API composers with provider services, service queries, and synchronous REST or gRPC calls.

Related concepts

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.