Articles

API Gateway vs Reverse Proxy: What's the Difference?

An API gateway and a reverse proxy both sit in front of your services, but a gateway adds API-specific logic a plain proxy doesn't. Here's the difference.

Chisato Chisato · · 4 min read
Network switch with patch cables

An API gateway is a reverse proxy with API-specific logic layered on top — authentication, rate limiting, request transformation, and routing to multiple backend services by API contract rather than just by hostname or path. Every API gateway is built on reverse proxy behavior; not every reverse proxy is an API gateway. The confusion is understandable because from the outside, both just look like “the thing in front of my services that requests hit first.”

What a plain reverse proxy does

A reverse proxy sits between clients and one or more backend servers, forwarding requests and returning responses, typically to handle concerns that don’t belong in application code: TLS termination, load balancing across replicas, compression, and basic path- or host-based routing. Nginx and Caddy in their default configurations are reverse proxies — fast, general-purpose, and largely unaware of what’s actually inside the requests they’re forwarding beyond the URL and headers needed to route them.

client → reverse proxy → backend service

That simplicity is the point. A reverse proxy doesn’t need to understand your API’s shape to do its job.

What an API gateway adds

An API gateway operates at the same position in the request path but adds a layer of logic aware of the API itself:

  • Authentication and authorization — validating an API key, OAuth token, or JWT before a request ever reaches a backend service, so individual services don’t each reimplement auth checks.
  • Rate limiting and quotas — enforcing per-client request limits, often per API key or per plan tier, which is meaningfully different from the connection-level throttling a plain proxy might do.
  • Request/response transformation — rewriting a legacy backend’s response shape into the public API contract, or aggregating calls to several backend services into one response for the client.
  • Routing by API version or contract — sending /v1/orders and /v2/orders to different backend deployments, not just different paths on the same service.
  • Centralized observability — logging, tracing, and metrics collected once at the gateway instead of separately in every service behind it.

Kong, AWS API Gateway, and Apigee are purpose-built API gateways; they can do everything a reverse proxy does, but they exist specifically to add this API-aware layer on top.

Side-by-side

Reverse proxyAPI gateway
Primary jobForward requests, terminate TLS, load balanceSame, plus enforce API-specific policy
Understands API contractsNo — routes by host/pathYes — routes by API version, validates schemas
Auth enforcementUsually not built inCommonly built in
Rate limitingBasic, connection-level at mostPer-client, per-key, plan-aware
Typical deploymentIn front of any web appIn front of a service-oriented or microservice backend

Where a service mesh fits in

It’s worth distinguishing both of these from a service mesh, which handles service-to-service traffic inside your infrastructure — retries, mutual TLS, and traffic shaping between your own microservices — rather than traffic coming in from external clients. A gateway sits at the edge, facing outward; a mesh sits internally, facing your own services talking to each other. Many microservices architectures use both: a gateway for north-south traffic (client to system), a mesh for east-west traffic (service to service).

When you actually need a gateway

A plain reverse proxy is enough for a large share of applications — a monolith or a small number of services behind a load balancer, where auth and rate limiting live in application code because there’s only one codebase to put it in.

An API gateway earns its complexity once you have multiple independently deployed services exposed through one public API surface, multiple client types (mobile, web, partner integrations) needing different policies, or a real need to decouple the public API contract from how backends are actually structured internally. Adding a gateway before you need one just adds an extra hop and another piece of infrastructure to operate — including in a Kubernetes environment, where an Ingress controller often already provides basic reverse-proxy routing, and a gateway would be layered on top of that, not instead of it.

The takeaway

A reverse proxy forwards and load-balances requests without caring what’s inside them. An API gateway does that plus enforces authentication, rate limits, and API-contract-aware routing — the logic you’d otherwise have to duplicate across every backend service. Start with a plain reverse proxy; reach for a gateway once you have enough independently deployed services, or few enough shared concerns across them, that centralizing that policy actually saves work instead of adding a layer for its own sake.

Chisato Chisato · · 5 min read

Logs vs Metrics vs Traces: The Three Pillars

Logs, metrics, and traces each answer a different question about a running system — what each captures, and how they work together.

#DevOps #Cloud #Developer Tools
Chisato Chisato · · 4 min read

Monorepo vs Polyrepo: Which Should You Choose

A monorepo holds all projects in one repository; a polyrepo splits them apart. Trade-offs in tooling, ownership, and CI/CD for each approach.

#DevOps #Developer Tools #Cloud