Menu

API GW vs ALB
πŸ“°

API GW vs ALB

DEV Community: awsΒ·DurgeshΒ·9 days ago
#tK0HSh4A
#devtoaws#devto#dev#gateway#path
Reading 0:00
15s threshold

On AWS, that question has two answers: API Gateway or an Application Load Balancer. I built with both to see where each one fits.

π—₯π—Όπ˜‚π˜π—Άπ—»π—΄

API Gateway: path + HTTP method β†’ integration (GET /items β†’ one Lambda, POST /items β†’ another)

ALB: listener rules, mostly by path (/browse β†’ one target group, /insert β†’ another)

𝗩𝗣𝗖

API Gateway: runs on AWS-managed infrastructure. There are no subnets to place it in.

ALB: lives in your VPC, across subnets in at least two Availability Zones.

π—”π˜‚π˜π—΅

API Gateway: API keys, IAM, Cognito, plus Lambda or JWT authorizers for external IdPs

ALB: Cognito or any OIDC-compliant IdP, handled at the listener

π—•π—²π˜€π˜ π—³π—Άπ˜

API Gateway: REST APIs and microservices that need throttling, caching and usage plans

ALB: web apps, container and EC2 backends, longer-running requests (API Gateway's integration timeout defaults to 29 s)

What surprised me: it isn't either/or.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.