API Gateway
Definition
A centralized server acting as a reverse proxy that sits between clients and a collection of backend microservices. It routes requests, composes responses, and enforces security policies.
Explain Like I'm New
A massive corporation has 50 different buildings (Microservices). You are a delivery driver. You don't want to figure out the map to all 50 buildings. You drop the package at the Front Security Desk (API Gateway). The Security Desk figures out exactly which building it needs to go to.
Real World Example
AWS API Gateway. A mobile app just makes requests to `api.company.com`. The API Gateway receives the request. If it's for `/billing`, it forwards it to the Python Billing Service. If it's for `/videos`, it forwards it to the Go Video Service. It also checks JWT tokens so the internal services don't have to.
Common Use Cases
- •Microservices architecture
- •Rate limiting
- •Authentication centralization
Terminal Output
Interview Questions
basic
- How does an API Gateway simplify the code written on the Frontend (Client)?
intermediate
- What is a 'Single Point of Failure' and how does it relate to an API Gateway?