SA-301f · Module 2

Gateway Design Patterns

4 min read

The API gateway sits at the boundary between external consumers and internal services. It handles the cross-cutting concerns that every request needs — authentication, rate limiting, request validation, protocol translation — so that internal services focus on business logic. The gateway is a load-bearing component: a misconfiguration affects every API consumer simultaneously. Its design must balance functionality with operational simplicity.

  1. Edge Gateway The single entry point for all external traffic. Handles TLS termination, authentication, rate limiting, and routing to internal services. The edge gateway is the simplest pattern and the right starting point. It separates external concerns from internal services without adding composition complexity.
  2. Internal Gateway A gateway between internal service tiers — for example, between the application layer and the data layer. Handles internal authentication, request validation, and routing. Internal gateways are useful when internal services have different trust levels or when cross-cutting internal policies must be enforced centrally.
  3. Gateway Mesh Multiple gateways organized by consumer type, region, or service domain. A mobile gateway handles mobile-specific concerns. A partner gateway handles partner authentication and rate limits. A regional gateway handles geographic routing. The gateway mesh provides specialization at the cost of operational complexity — more gateways to deploy, monitor, and configure.