Skip to the guide

API gateways

IntermediateConcept3 pages

An API gateway is the single front door to your APIs: every request from outside passes through it before it reaches a service. It does the jobs every service would otherwise repeat: checking who is calling, enforcing rate limits, sending each request to the right service, and recording what happened. You've met it as one kind of reverse proxy (Proxies). This guide is about what goes in it, what doesn't, and what it costs.

An airport

Every passenger enters through the same terminal. Passport control checks who you are. Check-in confirms you have a ticket and weighs your bag against your allowance. Signs send you to the right gate. Then, at the gate, the airline checks that you're booked on this particular flight. The airport doesn't decide who sits in seat 14C; the airline does.

  • the one terminal → the gateway: one public address in front of many services
  • passport control → authentication: is this token or API key valid, and whose is it?
  • the baggage allowance → rate limits and quotas for each customer
  • the signs to the gates → routing: /orders/… to the orders service, /users/… to users
  • the airline's check at the gate → authorisation inside the service: may this user see this order?