API gateway
A server that sits in front of one or more services and handles shared concerns such as routing, authentication, rate limits and TLS for every request.
In more detail
It should apply cross-cutting policy while each service still authorises access to its own resources and owns its schema and errors. Every hop adds latency and a failure point, so measure gateway time separately, propagate the request identifier, and test routes through the gateway.
Related terms
- reverse proxy — A server that receives requests on behalf of other servers and forwards them, returning their responses as if they were its own.
- cross-cutting concern — A need that applies across many services or endpoints, such as authentication, rate limiting, logging or TLS, rather than to one feature.
- TLS termination — Ending an encrypted TLS connection at a proxy or gateway, which decrypts the traffic and forwards it on to the service.
- rate limiting — Capping how many requests a client may make in a period of time, and rejecting or delaying the rest.
- correlation ID — A unique value attached to one request and passed along everywhere it goes, so its logs and traces can be found together.
- Backend for Frontend — A small backend service built for one specific frontend, which gathers data from other services and shapes it exactly for that frontend’s screens.
- network edge — The outermost layer of your system, where traffic from the internet first arrives.
- service mesh — A layer of proxies alongside every service that handles traffic between services: routing, retries, TLS and telemetry.
Taught in
- API Gateways And Proxies — Modern API Architecture: REST, GraphQL & gRPC
- Observability: Logs, Metrics, Traces — Modern API Architecture: REST, GraphQL & gRPC
- API Contract Architecture: OpenAPI 3.1 & Schema Truth — Production Full-Stack Engineering
- API Gateway & BFF Patterns: Backend-for-Frontend — Production Full-Stack Engineering
- Multi-Tenant Identity: Tenant Isolation & Middleware — Production Full-Stack Engineering
- Distributed Tracing: OpenTelemetry & Traceparent — Production Full-Stack Engineering
- Traffic Management: Sliding Window Rate Limiting — Production Full-Stack Engineering
- Secure Defaults — Application Security & Threat Modeling for Engineers
- Rate Limiting And Resource Consumption — Application Security & Threat Modeling for Engineers