IT Glossary
What is an API gateway and how does it work?
The server or service that sits between clients and an application’s services and through which every request passes: it checks, throttles and routes them to the right service.
- 7
- sections
- 6
- questions answered
An API gateway is the single entry point between clients (a website, a mobile app, partners) and an application’s services: it receives every request, checks who sent it, applies traffic limits and forwards each request to the right service, for example /orders to the orders service and /invoices to billing. Technically it is a reverse proxy specialised for APIs. It routes at layer 7 (by address, headers and request content) and takes over jobs every service would otherwise repeat: TLS termination, authentication, rate limiting and logging. The client sees one address, and the services behind it can be moved or rewritten without the client noticing.
For your company the gateway means one place to control and secure in front of partners and the mobile app: rules applied the same way for everyone, fewer possible weak points, and new integrations launched without touching the services behind it. It is also where API usage is metered per client, which matters as soon as you charge for access.
Why it matters for your business
Security enforced in one place
Authentication, filtering and rate limits are configured once at the door rather than separately in every service, where gaps inevitably appear over time.
Internal services free to evolve
You can rewrite or relocate the services behind it without partners and client applications noticing anything — the public address stays exactly the same.
Full visibility of traffic
Every request passes one point, so you know precisely who uses the API, how often and with what errors — data for billing and debugging.
How it works: the path of a request
A request reaches the gateway, which takes it on behalf of the services. First the encrypted connection (TLS) is terminated, then identity is checked: an API key or an OAuth token, each with its own glossary page. Next comes the per-client limit: over the quota, the request gets the HTTP 429 (Too Many Requests) response. Amazon API Gateway, for example, throttles requests with a token bucket algorithm and returns 429 when the limit is exceeded.
After the checks, the gateway picks the service by path or host, forwards the request, logs what happened and returns the response to the client. The services behind it receive only requests that have already been verified.
Routing, aggregation and shared functions
Microsoft’s Azure Architecture Center describes three patterns. Routing: a single entry point that sends requests to different services. Aggregation: one client call triggers several calls behind the scenes and the gateway returns a combined response, which saves network round trips for a mobile app. Offloading: TLS termination, authentication, IP allow and block lists, rate limiting, logging and monitoring, response caching, a WAF (web application firewall) and GZIP compression.
A common variant is “backends for frontends” (BFF): one gateway per type of client, for example one for web, one for mobile and one for third parties, each with responses shaped to its own needs.
Want an estimate for your project?
Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.
API gateway vs load balancer vs reverse proxy
A reverse proxy is an intermediary placed in front of servers that receives requests on their behalf (see the proxy page). A load balancer spreads traffic across copies of the same service and can work at layer 4 or 7; Azure Application Gateway, for example, is a layer-7 load balancer with routing and a WAF. An API gateway is a reverse proxy with API jobs: it knows who is calling, which keys or tokens are valid, what limit each client has and which service to send the request to.
They are usually used together. The Azure documentation notes that Azure API Management does not perform load balancing and should be paired with a load balancer such as Application Gateway, or with a reverse proxy.
API gateway examples
Managed cloud services: Amazon API Gateway (REST, HTTP and WebSocket APIs), Azure API Management, Google Cloud API Gateway and Apigee, Google Cloud’s API management platform. Self-hosted or open source: Kong Gateway (an open source image exists, the enterprise edition needs a licence), Apache APISIX (an Apache Software Foundation project) and Tyk Gateway (open source).
NGINX and HAProxy are often used as a reverse proxy in front of APIs, and Microsoft lists them as options for the gateway role. On cost, the licence model is what matters: managed services are usually billed by the number of requests, while open source means you install and operate it yourself.
When a company needs an API gateway and when it does not
You need one when you have several services or several external consumers (a mobile app, partners, B2B integrations), or a public API whose usage has to be metered. You do not need one for a monolith behind a single website: a well-configured web server or reverse proxy is enough (see the monolith vs microservices comparison).
A gateway also has costs: one more component to deploy and run, one more network hop on every request, and if it goes down the services behind it become unreachable. As a rule it runs in several copies, precisely so it does not become the weak point.
Frequently asked questions
Do I need an API gateway if I only have one application?
Usually not. A gateway earns its keep once you have several services or several external consumers — a mobile app, partners, a website. For a straightforward monolith, a well-configured web server with sound security rules covers the same ground.
What is the difference between an API gateway and a load balancer?
A load balancer spreads traffic across copies of the same service, at layer 4 or 7. An API gateway adds API-level jobs: who is calling, keys and tokens, per-client limits, routing to different services. They are often used together, and Azure API Management even expects a load balancer beside it.
Which API gateway products are used in practice?
In the cloud: Amazon API Gateway, Azure API Management, Google Cloud API Gateway and Apigee. Open source: Kong, Apache APISIX and Tyk. The choice depends on where your services run and how much control you want over monthly running costs.
Is Kubernetes Gateway API the same as an API gateway?
No. Gateway API is an official Kubernetes project, a set of resources (Gateway, HTTPRoute, GRPCRoute) for layer 4 and 7 traffic routing, and the successor to Ingress. Many API gateways implement it, but it is a specification, not a product.
What is the difference between an API gateway and API management?
The gateway is the component that handles each request at runtime. API management is the gateway plus a developer portal, keys and subscriptions, analytics and versioning. Apigee and Azure API Management describe themselves as API management platforms.
Does an API gateway replace a firewall?
No. It filters API traffic (authentication, IP lists, limits, and some products include a WAF), but the network firewall and DDoS protection are still needed. The gateway complements those measures rather than replacing them.
Let’s talk about your project
Book a free 30-minute call or send us an email. We reply the same working day.
office@northdan.com · +40 750 252 851