← Lessons

quiz vs the machine

Gold1430

System Design

API Gateway Aggregation

One entry point that fans out and combines responses.

5 min read · core · beat Gold to climb

A Single Front Door

In a microservice system, clients should not call dozens of services directly. An API gateway is one entry point that handles cross cutting concerns and routes each request to the right service. With aggregation, the gateway calls several services for one client request and merges their replies into a single response.

What the Gateway Handles

  • Authentication, rate limiting, and TLS termination in one place.
  • Routing and aggregation of multiple backend calls.
  • Protocol translation, such as exposing REST over internal gRPC.

Aggregation Care

Fan out calls in parallel so total latency is the slowest call, not the sum. Decide how to handle a partial failure; often the gateway returns the data it got plus an error note for the missing piece.

Watch the Risks

A gateway can become a bottleneck or a single point of failure, so run it replicated behind a load balancer. Keep business logic out of it; the gateway routes and composes, it does not own domain rules.

Key idea

An API gateway is a single entry point that handles cross cutting concerns and aggregates parallel service calls into one response, while staying replicated and logic free.

Check yourself

Answer to earn rating on the learn ladder.

1. Why should a gateway fan out aggregation calls in parallel?

2. What should an API gateway avoid holding?