AWS · explainer · checked November 4, 2026
API Gateway vs load balancer: when to use Amazon API Gateway or Elastic Load Balancing
They solve different problems. Amazon API Gateway is a front door for APIs: it authorizes callers, throttles requests and routes each one to a backend such as AWS Lambda. Elastic Load Balancing spreads incoming traffic across many servers or containers and sends it only to healthy ones. Use API Gateway to manage an API, a load balancer to share load, and both when an API fronts a load-balanced service.
Side by side
| Amazon API Gateway | Application Load Balancer | Network Load Balancer | |
|---|---|---|---|
| Main job | Create, publish, secure and monitor REST, HTTP and WebSocket APIs | Route HTTP and HTTPS requests to targets by their content | Pass TCP, UDP, TLS and QUIC connections to targets |
| Layer | Works on API requests (REST, HTTP and WebSocket) | Layer 7 of the OSI model | Layer 4 of the OSI model |
| Decides by | The API’s routes and methods | Listener rules: path, host, HTTP header, method, query parameter, source IP address | Listener and target group; for TCP and UDP traffic a flow hash picks the target |
| Backends | AWS Lambda, public HTTP endpoints, other AWS services, and private resources through VPC links | EC2 instances, containers, IP addresses and Lambda functions | EC2 instances, IP addresses and an Application Load Balancer |
| Access control | IAM, Lambda authorizers, Amazon Cognito (and JWT on HTTP APIs) | Can authenticate users through corporate or social identities; works with AWS WAF | Works at layer 4, so it does not look inside HTTP requests |
| Special features | Throttling; for REST APIs also API keys and usage plans, request validation, caching and canary releases | Redirects, custom HTTP responses, Lambda targets | Static IP addresses and Elastic IP addresses, millions of requests per second |
Two different jobs
The two names show up in the same searches because both sit between a client and your code. What they do there is different.
Amazon API Gateway is a service for creating, publishing, maintaining, monitoring and securing REST, HTTP and WebSocket APIs. AWS describes it as a “front door” for applications to reach backend services, such as workloads on Amazon EC2, code on AWS Lambda or any web application. The work it does is about the API: who may call it, how often, with what shape of request, and which backend answers.
Elastic Load Balancing (ELB) automatically distributes incoming traffic across multiple targets, such as EC2 instances, containers and IP addresses, in one or more Availability Zones. It monitors the health of its targets, routes traffic only to healthy ones, and scales its own capacity as traffic changes. Its work is about spreading load and surviving failures, not about managing an API.
What API Gateway adds
Choose API Gateway when the thing you are exposing is an API with callers you need to control. It supports several ways to authenticate: AWS Identity and Access Management (IAM) policies, Lambda authorizer functions and Amazon Cognito user pools. It supports custom domain names. REST APIs, but not HTTP APIs, integrate with AWS WAF and support canary release deployments.
There are two kinds of HTTP-based API, and they differ. REST APIs support more features: the documentation says to choose them if you need API keys, per-client throttling, request validation, AWS WAF integration or private API endpoints. HTTP APIs have minimal features so they can cost less. WebSocket APIs keep a two-way connection open and route each message based on its content.
Two cautions come from the documentation. API keys and usage plans are not for access control: AWS says not to use API keys for authentication or authorization, and to use an IAM role, a Lambda authorizer or a Cognito user pool instead. Usage plan throttling and quotas are applied on a best-effort basis, so they are not a hard guarantee against overspending. Separately, each account has a default throttle quota of 10,000 requests per second per Region across its APIs in most Regions (2,500 in a few newer ones), and the quota can be raised.
What a load balancer adds
Choose a load balancer when you have several copies of a server or container and want traffic shared between them, with unhealthy copies taken out automatically. It is the usual way to put an Amazon EC2 Auto Scaling group or an Amazon ECS service behind a single address.
The Application Load Balancer (ALB) works at layer 7. A listener holds rules, and each rule has conditions and an action. Conditions can match the URL path, the host name, HTTP headers and methods, query parameters and source IP addresses, so one ALB can send /orders to one service and /users to another. An ALB can also redirect, return a fixed HTTP response, authenticate users before routing, and use AWS WAF.
The Network Load Balancer (NLB) works at layer 4 and handles TCP, UDP, TLS and QUIC traffic. The documentation says it can handle millions of requests per second and gives each enabled Availability Zone a static IP address, with an optional Elastic IP address per subnet. It does not look inside HTTP requests. As a rule of thumb, look at it for non-HTTP protocols, for fixed IP addresses, or for very high request rates.
Overlap: Lambda behind either one
The confusion is worth clearing up because both can put a front on a Lambda function. An ALB can register a Lambda function as a target and invoke it directly. The documented limits are a 1 MB request body and a 1 MB response, and WebSockets are not supported for Lambda targets. API Gateway fronts Lambda too, and adds authorizers, throttling and request validation in front of the function.
In short, if you need API management features, use API Gateway. If you only need to route web requests to Lambda alongside servers or containers, and you do not need those features, an ALB can do it.
Using them together
They are often combined. API Gateway can reach private resources inside an Amazon VPC through a VPC link. The documentation lists private integrations with both Network Load Balancers and Application Load Balancers for REST APIs and HTTP APIs. A typical shape is: clients call API Gateway, which authenticates and throttles them, and which forwards allowed requests through a VPC link to an internal load balancer in front of containers or instances.
That keeps the servers off the public internet, puts API controls at the edge, and still gives you load sharing and health checks behind it.
A quick way to choose
- Callers need keys, quotas, authorizers or request validation: API Gateway.
- Many identical servers or containers need to share web traffic: Application Load Balancer.
- TCP or UDP traffic, or a fixed IP address: Network Load Balancer.
- A public API in front of a private load-balanced service: API Gateway with a VPC link to the load balancer.
On the exams
How certification exams use this
The exam guides ask candidates to design for these services. The Solutions Architect Associate guide lists API creation and management with Amazon API Gateway (knowledge item 2.1.k1), load balancing concepts (2.1.k9) and choosing among Application, Network and Gateway Load Balancers by layer (4.2.s1). The Solutions Architect Professional guide has a skill on choosing a load balancer or API Gateway for a traffic pattern (1.1.10) and one on API Gateway WebSocket APIs (1.1.12). The Developer Associate guide covers API Gateway features and stages (3.1.5), and the Cloud Practitioner guide covers the purpose of load balancers (3.3.s5). Watch the wording: API keys, per-client throttling or request validation point at API Gateway, path-based routing across containers points at an ALB, and a requirement for static IP addresses points at an NLB. The usual wrong answer treats one as a replacement for the other.
Test yourself
See how well you know it, free.
Each exam’s diagnostic is free, with no sign-in: questions across the whole exam, and a map of what you know and what you don’t.
AWS Certified Solutions Architect – Associate
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Solutions Architect – Professional
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Developer – Associate
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified DevOps Engineer – Professional
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Cloud Practitioner
20 free questions, no sign-in.
Take the free diagnosticAbout the examAWS Certified Security – Specialty
20 free questions, no sign-in.
Take the free diagnosticAbout the exam
Sources
Checked against the vendors’ own documentation.
- What is Amazon API Gateway?
- Choose between REST APIs and HTTP APIs
- Usage plans and API keys for REST APIs in API Gateway
- Amazon API Gateway quotas
- Tutorial: Create a REST API with a private integration
- What is Elastic Load Balancing?
- What is an Application Load Balancer?
- What is a Network Load Balancer?
- Use Lambda functions as targets of an Application Load Balancer
Last checked November 4, 2026. Spotted something wrong or out of date? Tell us.