Design: Request Aggregation Service
Design the aggregation layer and its interaction with microservices. Out of scope: internal microservice implementations and client-side logic.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
Client | v Aggregation API (API Gateway) | |---> Cache (Redis) | |---> Microservice A | |---> Microservice B | |---> Microservice C | v Aggregated Response
async function aggregate() {
const user = await getUser();
const orders = await getOrders(user.id);
const payments = await getPayments(user.id);
return { user, orders, payments };
}
What is the main problem with this code?