Architecturegatewayedge service

API gateway

Definition

An API gateway is a reverse proxy dedicated to APIs: it receives client requests, applies shared policies such as authentication, quotas and transformation, and routes each request to the right backend service.

In practice

Clients get one stable host and one auth model regardless of how many services sit behind it, and teams stop re-implementing the same edge logic in every service. Gateways can also aggregate several backend calls into one response for mobile clients.

The gateway sits on every request path, so it adds a hop of latency and must be highly available. Putting business logic in it creates a new monolith that every team has to change; keep it to cross-cutting concerns.

Example

Requests to api.example.com/orders/* are authenticated and rate limited at the gateway, then forwarded to the orders service; /users/* goes to the users service.