← Back to microservices patterns mapquery
🔀
Microservices Pattern
API Composition
Aggregate data from multiple services into one response.
Detailed Description
API composition is useful when a client needs data owned by multiple services.
Protect it with timeouts, partial responses, caching, and careful fan-out limits.
Visual Diagram
Client -> Composer -> UserService -> OrderService -> PaymentService <- combined response
Tradeoffs
Pros
Simple for clients, no shared database
Cons
Can create latency fan-out
Examples: GraphQL resolvers, BFF aggregators