Routing
An API gateway provides a single address to clients and takes care of routing client requests to an appropriate service. For example, a market data service that publishes hundreds of services through an API gateway that can be accessed via a single domain name. The gateway performs a mapping between a requested URL and services.Decoupling
Routing decouples clients and services. This may allow you to change your services without impacting clients.Load Balancing
API gateways may implement load balancing whereby requests are distributed to many instances in order to achieve unlimited scale.Microservices
API gateways may connect to a wide range of API architectures. However, they are particularly associated with microservices, an architectural technique that divides functionality into small individually deployable services. Microservices are kept extremely lightweight and benefit from the ability to offload functionality to the API gateway.Composition
The ability to call multiple services to build a response for a single client request. This allows client interfaces to be simplified and designed for client needs while allowing implementation to be decomposed into lightweight and scalable microservices.Latency Reduction
Composition of services can be designed to reduce overall network latency. For example, an API gateway may allow a client to make a single request that results in dozens of API calls on behalf of the client by the gateway. Assuming the gateway is in close proximity to the deployed APIs this can significantly reduce total latency.Transformations
Transforming the responses of services into a message format that is expected by a client.Gateway Offloading
Gateway offloading is the assignment of functionality to an API gateway that is common to many of your services. This allows you to keep your services lightweight and to standardize certain functionality such as authentication.Authentication
A gateway is client facing and must handle any required authorization and authentication of client requests.Firewall
It is common for an API gateway to offer a web application firewall that provides network security functions such as IP whitelisting.Rate Limiting
Controlling the rate at which a single client is entitled to a response in order to prevent a small number of clients from overwhelming your services.Encryption
Encryption functionality such as handling SSL connections.Compression
Compression of responses can be offloaded to an API gateway.Caching
An API gateway may cache responses to reduce load on APIs and improve response times. For example, an ecommerce API that returns a product description for an item id may safely cache these responses for several hours as this information doesn't change often.Monitoring
As a central controller for a variety of API services, an API gateway is a natural place to monitor your APIs for performance, security and SLA management purposes.Audit Trail
Requests and response data may be logged and can serve as an important audit trail.Analytics
An API gateway may provide native analytics to explore data generated by API requests and responses. Alternatively, such data may be integrated with an analytics tool.Overview: API Gateway | ||
Type | ||
Definition | A reverse proxy that routes requests from clients to services. | |
Related Concepts |