/System Design /API Gateway ← All Designs
🔀

API Gateway

Single entry point that handles auth, routing, rate limiting, and more

System Design Phase 4
CLIENT LAYER
💻
Web Client
📱
Mobile App
🖥️
Desktop
↓ HTTPS
API GATEWAY LAYER
🔀 API Gateway (Kong / nginx / AWS API GW)
🔐 SSL Terminate 🔑 Auth Check 🚦 Rate Limit 🔀 Route 📦 Transform 💾 Cache
↓ HTTP
MICROSERVICES LAYER
0
Total Requests
Cache Hit Rate
0ms
Avg Latency
0
Requests Blocked
Active Feature Descriptions
When to Use

Any microservice architecture with external clients — the gateway consolidates cross-cutting concerns like auth, logging, rate limiting, and SSL in one place, so each service stays focused.

Trade-offs

The gateway is a single point of failure — it must be deployed in an HA cluster. It adds a network hop per request (~2–5ms). At extreme scale it can itself become a bottleneck and must be scaled horizontally.

Interview Tip

"The gateway handles cross-cutting concerns so individual services don't have to." Mention Kong, AWS API Gateway, or nginx. Always discuss: what happens if the gateway goes down? (circuit breaker, multiple AZ deployment, health checks)