ALB vs NLB vs API Gateway — A Story of Three Gatekeepers (And How to Choose the Right One)
Let me explain this in a way I wish someone had explained it to me earlier.
ALB vs NLB vs API Gateway — A Story of Three Gatekeepers (And How to Choose the Right One)

Let me explain this in a way I wish someone had explained it to me earlier.
Imagine your application is a large corporate office building.
Every day, thousands of people (requests) arrive:
- Some are customers
- Some are internal employees
- Some are delivery agents
- Some… you don’t even trust
Now, you don’t let everyone walk in the same way, right?
👉 You hire different types of gatekeepers.
In AWS, those gatekeepers are:
- ALB (Application Load Balancer)
- NLB (Network Load Balancer)
- API Gateway
And choosing the wrong one is like putting a security guard where you needed a receptionist… or worse, a receptionist where you needed armed security.
Meet the 3 Gatekeepers
1. ALB — The Smart Receptionist
This is the person at the front desk who actually understands what visitors are saying.
You walk in and say:
“I’m here for the finance team.”
She replies:
“Second floor, left side.”
Another person says:
“I need tech support.”
She routes them somewhere else.
That’s exactly what ALB does.
It understands:
- URLs (
/api,/login) - Domains (
app.company.com,admin.company.com) - Headers and rules
Real Scenario
You built a system:
/→ Frontend (React)/api→ Backend (Node.js)/admin→ Admin panel
ALB routes traffic based on what the request is asking for.
When ALB is your best friend
Use ALB when:
- You’re building web apps
- You have multiple services behind one URL
- You want clean routing without complexity
When ALB will disappoint you
- Ultra-low latency systems
- Non-HTTP traffic (like raw TCP/UDP)
2. NLB — The Silent Security Guard
Now imagine a different kind of guard.
He doesn’t ask questions. He doesn’t care who you are. He just checks your pass and lets you in FAST.
No conversation. No delay.
That’s NLB.
It works at a lower level and focuses on:
- Speed
- Performance
- Stability
Real Scenario
You’re building:
- A trading platform
- A gaming backend
- A real-time chat server
Here, every millisecond matters.
You don’t want a “smart receptionist” slowing things down.
You want fast pass-through traffic.
When NLB is the right choice
Use NLB when:
- You need extreme performance
- You deal with TCP/UDP traffic
- You want static IPs
- You care about low latency over intelligence
When NLB is a bad idea
- When you need routing like
/apivs/admin - When you want HTTP-level features
NLB is powerful, but not smart
3. API Gateway — The Strict Security Manager
Now imagine someone even more powerful.
This person doesn’t just guide or allow entry… They verify identity, enforce rules, and monitor everything.
They might say:
- “Show your ID”
- “You’ve made too many requests today”
- “You are not authorized”
That’s API Gateway.
It’s not just routing — it’s control + security + governance
Real Scenario
You’re building:
- A mobile app backend
- A public API
- A serverless system using Lambda
You need:
- Authentication (JWT, Cognito)
- Rate limiting
- Request validation
API Gateway becomes your frontline defense
When API Gateway shines
Use API Gateway when:
- You’re exposing APIs to external users
- You need security & throttling
- You’re working with Lambda / serverless
- You want managed API infrastructure
When it’s overkill
- Simple internal routing
- High-volume internal traffic (can get expensive)
Sometimes people use API Gateway everywhere… and regret the bill later.
️ The Real Difference (No Jargon)
Let’s simplify this brutally:
- ALB → “Let me understand your request and route you correctly”
- NLB → “I don’t care, just go through FAST”
- API Gateway → “Who are you? Are you allowed? Now proceed”
A Real Architecture (How Pros Use Them)
In real-world systems, they’re not competitors — they’re teammates.
Example:
- CloudFront → Handles global traffic
- API Gateway → Handles external APIs securely
- ALB → Routes internal microservices
- NLB → Handles high-performance backend systems
The best architects don’t pick one… They combine them smartly
The 3 Questions That Will Save You
Whenever you’re confused, just ask:
1️⃣ Do I need smart routing (URLs, paths)?
👉 Use ALB
2️⃣ Do I need raw speed and performance?
👉 Use NLB
3️⃣ Do I need security, throttling, and API control?
👉 Use API Gateway
The Lesson I Learned (The Hard Way)
Early in my career, I used: ALB for everything
It worked… until:
- Costs increased
- Performance dropped
- Security became complex
That’s when I realized:
AWS doesn’t give you multiple services to confuse you It gives you options to design better systems
Final Thought
Choosing between ALB, NLB, and API Gateway is not about:
“Which one is best?”
It’s about:
“Which one fits this specific problem?”
Once you start thinking this way, you stop building just working systems…
…and start building well-architected systems.
메타데이터
- post_id
- 058cbbc2f71d
- slug
- alb-vs-nlb-vs-api-gateway-a-story-of-three-gatekeepers-and-how-to-choose-the-right-one-058cbbc2f71d
- url
- https://aws.plainenglish.io/alb-vs-nlb-vs-api-gateway-a-story-of-three-gatekeepers-and-how-to-choose-the-right-one-058cbbc2f71d
- canonical_url
- https://aws.plainenglish.io/alb-vs-nlb-vs-api-gateway-a-story-of-three-gatekeepers-and-how-to-choose-the-right-one-058cbbc2f71d
- author_url
- https://medium.com/@sakev.chauhan
- status
- ok
- fetched_at
- 2026-06-09 15:37:30