Command Palette

Search for a command to run...

PHASE 9Intermediate ~6 min· topic 7 of 9

Topic 9.7

API Gateway

In one line

The L7 front door for APIs: routing, auth, quotas, aggregation, and the single integration point for clients.

0/9 · 0%

Think of it like this

Airport security and check-in, which every passenger passes through regardless of which airline or gate they're headed to. One single checkpoint that verifies your ticket, checks your bags, and then routes you to the right terminal.

Key ideas

  1. 01

    Gateway = reverse proxy for a service fleet PLUS policy: authn/authz, rate limits, request validation, routing, response transformation.

  2. 02

    Client benefits: ONE endpoint to integrate ('/v1/*' → routed internally), SDK simplicity.

  3. 03

    Ops benefits: quotas per client, circuit-breaking downstream, observability hooks in one place.

  4. 04

    Aggregation: graphql-style one gateway call fanning to several services (BFF pattern) — powerful, latency-heavy.

  5. 05

    Gateway vs Service Mesh: gateway = external edge; mesh (istio/linkerd) = internal service-to-service with the same trick.

  6. 06

    Interview: gateways are the 'and then all requests pass through a gateway for auth and quotas' sentence every HLD wants.

Java / Spring map

  • →

    Spring Cloud Gateway; Zuul legacy; Kong/Envoy/AWS API Gateway are the infra answers.

Code & diagrams

what the gateway does for every requestdiagram
Rendering diagram…

Explain without notes

01

Name two things the gateway must NOT do (that tempt everybody) and why.

Practice

01

Design the gateway route table + quota policy for your food-delivery APIs.

Trade-offs

  • ↔

    Centralization = easy policy, single choke point to scale and monitor; keep gateways stateless + replicated.

Run it in production

Completion checklist

  • I place a gateway at the edge with concrete responsibilities and name its scaling story.

Back to phase