Free — no signup required

Introduction: The Digital Front Door

2 min read

The Problem: Microservice Chaos

Imagine you're running a hotel with 50 different departments — housekeeping, room service, concierge, valet, spa, and so on. If every guest had to call each department directly, memorize 50 different phone numbers, and figure out each department's own rules, the experience would be chaotic. Instead, you have a single front desk that routes every request to the right place, handles authentication ("Are you a registered guest?"), and enforces policies ("No room service after midnight").

Amazon API Gateway is that front desk for your backend services. It sits between your clients (mobile apps, browsers, other services) and your backend (Lambda functions, EC2 instances, DynamoDB, or any HTTP endpoint), handling the cross-cutting concerns that would otherwise be duplicated across every service.

It handles the heavy lifting so your code doesn't have to:

  • Traffic Management: Throttling, routing, and versioning — ensuring no single client can overwhelm your backend.
  • Security: Authentication (Cognito/IAM) and authorization — verifying identity before a request ever reaches your code.
  • Transformation: Converting an XML request into JSON before it hits your Lambda, or reshaping a response before it reaches the client.
  • Observability: Built-in logging to CloudWatch and optional tracing with AWS X-Ray.

It is a fully managed service. You don't provision servers, patch operating systems, or manage load balancers. You define your API — its routes, methods, and integrations — and AWS handles the rest.

Interview Tip

Interviewers often ask: "Why not just put an Application Load Balancer in front of your Lambda functions?" The key distinction is that API Gateway is API-aware — it understands HTTP verbs, path parameters, query strings, and request/response bodies at the application layer. It also natively integrates with Cognito, IAM, and Lambda Authorizers for authentication, and supports usage plans for API monetization. An ALB is a Layer 7 load balancer optimized for routing traffic to compute targets; API Gateway is a full API management platform. Use ALB when you need high-throughput HTTP routing to containers or EC2. Use API Gateway when you need API lifecycle management, fine-grained auth, or serverless integration.

This is one of 18 chapters

Get every chapter — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

See pricing