API Gateway Pattern

Request routing, composition, protocol translation, rate limiting, and centralized authentication for microservices.

Overview

Overview The API Gateway pattern provides a single entry point for all client requests in a microservices architecture. Instead of having clients call dozens of individual services directly, the gateway acts as a reverse proxy that routes requests, aggregates responses, and handles cross-cutting concerns like authentication, rate limiting, and logging.

At companies like Netflix (Zuul/Spring Cloud Gateway), Amazon (API Gateway), and Kong, the gateway is the front door to the entire platform. It decouples clients from the internal service topology, allowing teams to refactor, split, or merge services without breaking client contracts.

Understanding the API Gateway pattern is essential for system design interviews because it appears in virtually every microservices discussion. Interviewers expect you to reason about trade-offs such as single point of failure, added latency, and the risk of the gateway becoming a monolithic bottleneck.

Key concepts

  • Request routing and load balancing
  • API composition and aggregation
  • Protocol translation (REST, gRPC, WebSocket)
  • Rate limiting and throttling
  • Authentication and authorization offloading
  • Request/response transformation
  • Cross-cutting concerns centralization
  • Edge functions and middleware chains

Interview questions

  • How does an API Gateway differ from a reverse proxy or load balancer?
  • What are the risks of the API Gateway becoming a bottleneck, and how do you mitigate them?
  • How do you implement API composition at the gateway?
  • Compare popular API Gateway implementations and when to choose each.

Sign up free to read the full topic

More Microservices topics

Start free on Cariara · Coding problems · System design studio