Explain API Composition vs Aggregation.

API composition and API aggregation are patterns for combining results from multiple microservices: composition orchestrates several service calls, while aggregation merges their outputs into a single response.

When to Use

Use these patterns when one client request requires data from multiple services—for example, a dashboard that needs user info, transactions, and notifications together.

Example

A user profile page can call both the profile service and the order service, returning one unified response instead of multiple calls.

Want to master these concepts for interviews?

Explore Grokking System Design Fundamentals, Grokking the System Design Interview, Grokking Database Fundamentals for Tech Interviews, Grokking the Coding Interview, or try Mock Interviews with ex-FAANG engineers.

Why Is It Important

Efficiency improves because multiple calls collapse into one, reducing latency and centralizing error handling.

Interview Tips

Frame your answer around performance benefits, client simplicity, and backend trade-offs. Use simple examples (like the profile aggregator) to show clear understanding.

Trade-offs

Pros: Reduced network calls, unified data, better client experience. Cons: Backend complexity, potential single point of failure, slower if one service lags.

Pitfalls

A common mistake is ignoring partial failures—decide whether to return partial results or fail entirely. Another risk is making the aggregator itself a bottleneck, which can be avoided with caching or async calls.

TAGS
System Design Interview
System Design Fundamentals
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Image
One-Stop Portal For Tech Interviews.
Copyright © 2025 Design Gurus, LLC. All rights reserved.