From the course: DevOps Foundations: Microservices

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

API composition

API composition

Simple calls from a client to a service are easy to implement. However, microservice-based systems often have more complex calling patterns. API composition is called for when a client or service needs to orchestrate calls to multiple services. Monolithic applications make data query simple. A SQL query can join multiple tables spanning across data contexts and return a bespoke data object. By contrast, querying data is more complex in a microservices architecture. Microservices have narrowly defined data contexts by design, so data contexts are split up between microservices. So, we need a way to manage a unit of work that requires data from multiple downstream resources, while maintaining data consistency as best we can. This technique is generally referred to as API composition. There are two general ways to apply this pattern: Commercial products and custom code. API composition is a pattern in which some mediator, referred to as an API composer, handles the work of calling out to…

Contents