Core Responsibilities
The capabilities that justify the gateway's existence — routing, load balancing, SSL termination, protocol translation, and request/response transformation.
What is an API Gateway
An API Gateway is a single entry point that sits between external clients and your internal services. It accepts all incoming API requests, applies cross-cutting policies (, , logging), and routes them to the appropriate backend service. Clients never talk directly to your microservices — they talk to the gateway.
The Hotel Front Desk
An API Gateway is like a hotel front desk. Guests (clients) don't wander the hallways looking for housekeeping, room service, or maintenance. They go to the front desk, which verifies their identity (auth), checks if they're allowed (authorization), and routes their request to the right department. The departments don't need to handle check-in or verify room keys — the front desk already did that.
The Three Things a Gateway Does Well
Core Gateway Functions
- ✅Traffic management — routing, load balancing, rate limiting, circuit breaking
- ✅Security boundary — authentication, authorization, TLS termination, IP filtering
- ✅API lifecycle — versioning, transformation, documentation, monitoring
What a Gateway is NOT
What Does Not Belong in a Gateway
- ❌Business logic — never put domain rules in the gateway
- ❌Data storage — the gateway should be stateless (except caching)
- ❌Service-to-service communication — that's a service mesh concern (east-west)
- ❌Heavy computation — transformation should be lightweight, not CPU-intensive
North-South vs East-West Traffic
The gateway handles north-south traffic — requests from external clients entering your system. East-west traffic (service-to-service communication within your cluster) is handled by a service mesh (Istio, Linkerd) or direct calls. Conflating the two leads to the gateway becoming a bottleneck for internal communication.
| Concept | Gateway (North-South) | Service Mesh (East-West) |
|---|---|---|
| Traffic direction | External → Internal | Internal → Internal |
| Clients | Mobile apps, browsers, partners | Microservices talking to each other |
| Auth model | API keys, JWT, OAuth | mTLS, SPIFFE identities |
| Typical tool | Kong, AWS API Gateway | Istio, Linkerd, Consul Connect |