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. API Gateway can sit in front of a private ALB through a VPC Link.
I'm still learning, but now I choose based on routing and auth needs, not habit.
Which one do you reach for first, and why?

