Beginner LevelREST APIs & Web Services
What is an API Gateway and what roles does it perform in backend architecture?
❓ Interview Prompt: Explain API Gateway pattern (Kong, AWS API Gateway, NGINX), reverse proxy, centralized auth, rate limiting, request routing, and SSL termination.
An API Gateway acts as a single centralized entry point (Reverse Proxy) for all external client requests entering a microservices backend architecture:
Core Responsibilities:
1
Request Routing: Maps public URIs ('/api/v1/orders') to internal microservice IP addresses ('10.0.1.45:8080').
2
Cross-Cutting Concerns: Handles SSL/TLS termination, authentication token validation, rate limiting, CORS headers, and logging in one central place!
3
Protocol Translation: Translates external HTTP/REST JSON calls into internal gRPC or Kafka event streams.
Code Implementation Example
yaml
# Example Kong API Gateway Route Configuration
services:
- name: user-service
url: http://internal-user-service.local:8080
routes:
- name: user-route
paths:
- /api/v1/users
strip_path: false💡Kong API Gateway routing public URI paths to internal microservice cluster IPs.
🎯 Interview Key Takeaway
API Gateways centralize routing, authentication, rate limiting, and SSL termination in front of backend microservices.
#API Gateway#Architecture#Reverse Proxy#Beginner
Back to all REST APIs & Web Services Questions→