API Gateway
What is an API Gateway?
An API Gateway is a API management tool that sits between a client and a bunch of backend APIs. Its primary role is to act as a single entry point and standardized process for interactions between an organization’s apps, data and services and internal and external customers.
Advantages of an API Gateway
- A key benefit of an API gateway is the abstraction of the backend microservices. Clients just programme to the external API contract.
- Decouples clients from backend. Backend engineers can change the backend microservices and even the architecture without needing the client to change code.
- API Management
- Security
- High availability - If there are failures in the backend services, the API gateway can mask them by returning cached or default data.
What functions does it provide?
- Authentication
- Rate limiting
- Statistics (can be used for monetisation)
- API Composition
- Request routing
- Protocol translation
- Custom endpoints based on client
- Policies
- Alerts
- Service discovery
- Stabilization and [load balancing]
- Caching
Disadvantages of API gateway
- Slower from a networking perspective as usage of an API Gateway means at least one extra network hop.
- Extra layer of complexity to manage.
- Single point of failure so you have to make the API Gateway HA.