Skip to the page

AWS for developers · senior

Choosing the entry point and the compute

Choose by traffic shape, latency, run time, team skills and who is on call. API Gateway, an ALB and a function URL each fit different needs, and so do Lambda, Fargate and EKS.

The notes

What you must know

  • REST API in API Gateway: usage plans and API keys for per-client throttling, request validation, caching, WAF, private APIs, canary stages. Integration timeout is 29 seconds by default and can be raised only for Regional and private REST APIs.
  • HTTP API: cheaper and simpler, with a built-in JWT authorizer and Lambda authorizers, but no usage plans or WAF directly, and an integration timeout of at most 30 seconds.
  • ALB: hourly plus capacity-unit pricing that suits steady high traffic. It can mix Lambda and container targets. Lambda request and response bodies are limited to 1 MB.
  • Function URL: free and simplest, IAM or no auth, runs as long as the function timeout and supports response streaming, but has no per-client throttling.
  • Ask first: traffic shape, latency needs, run time of jobs, what the company already runs, team skills, who is on call.
  • Lambda: no servers, scales to zero, pay per request, one request per environment (cold starts, database connections), a maximum run time. Good for spiky, event-driven work. Long jobs belong elsewhere.
  • ECS on Fargate: run a container without managing nodes, with a task definition, a service, a load balancer and autoscaling. EKS: Kubernetes API and ecosystem, but you operate more (add-ons, upgrades, networking) and need the team skills.
  • Choose the simplest option that meets the need, and write down why.

The red pen

Common traps: mistake → fix

  • Mistake: Lambda is always cheapest

    Fix: At steady high traffic a container service can cost less.

  • Mistake: EKS is the default for containers

    Fix: ECS on Fargate is simpler when you do not need the Kubernetes ecosystem.

  • Mistake: API keys in API Gateway are authentication

    Fix: AWS docs say not to use usage-plan API keys for authentication. They are for throttling and quotas.

Easy to hard

Questions interviewers ask, easy to hard

  1. When would you choose API Gateway, an ALB or a Lambda function URL?
  2. What is the difference between REST API and HTTP API in API Gateway?
  3. Lambda, ECS on Fargate or EKS for a new service? What do you ask?
  4. What are the limits of Lambda that change the design?
  5. Design the entry and compute for a spiky partner API.

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview