Skip to content
Technology transformation expertise firm · ARDIANE Group Innovate, secure, succeed

Glossary

API gateway: definition, functions and limitations

Domain

Engineering

In brief

An API gateway is the component placed in front of a set of services to offer their clients a single entry point: it receives each call, routes it to the relevant service and can provide common functions, such as authentication or rate limiting. The notion comes from common usage and from published architecture patterns.

Page contents

Definition of the API gateway

An API gateway (passerelle d’API in French) is a software component placed between client applications and the services they call. Clients know only the gateway: it receives their calls and forwards them to the relevant services. The notion is one of common usage: it can be found in published architecture patterns and in vendor documentation.

On the microservices.io website, Chris Richardson ties the “API gateway” pattern to microservices architecture and describes it as a single entry point for all clients: the gateway relays some requests to one service and answers others by querying several services. The Microsoft Azure Architecture Center gives a similar reading: a centralised entry point, which acts as a reverse proxy and can handle cross-cutting tasks.

What the gateway spares clients and services

Without a gateway, every client addresses every service. The Microsoft page lists the consequences: more complex client code, tied to the internal breakdown of the application, multiplied network round trips for a single operation, and authentication or encryption to be handled in each exposed service.

The microservices.io page adds that the breakdown into services may change and is best kept hidden from clients. During a step-by-step overhaul, a gateway can play the role of the routing facade presented on our page on application modernisation.

Routing, aggregation, offloading: the functions of an API gateway

The Microsoft documentation sorts the uses into three patterns.

  • Routing (gateway routing): the gateway directs each request to the intended service, based on its application content (layer 7).
  • Aggregation (gateway aggregation): the client sends a single request, the gateway calls several services and assembles their responses.
  • Offloading (gateway offloading): cross-cutting functions are provided once for all services, for example TLS termination, mutual TLS, authentication, rate limiting or logging.

API gateway, reverse proxy, load balancer, service mesh, API management: not to be confused

These terms are ones of common usage, and their scopes overlap from one product to another.

Notion What it refers to Relationship with the gateway
Reverse proxy An intermediary server that receives requests in place of the application servers, such as NGINX or HAProxy The gateway is one, specialised in APIs
Load balancer Distributing requests between the instances of the same service Depending on the product, the gateway provides it or relies on an adjacent load balancer
Service mesh A layer of network proxies that manages exchanges between services, such as Istio or Linkerd The gateway handles calls coming from clients, the mesh internal exchanges
API management The discipline and tooling of the API lifecycle The gateway is its runtime component

Inventory, developer portal and versioning policy are described in the API management entry.

The limitations of a mandatory passage point

The microservices.io page notes two drawbacks: one more component to develop, deploy and operate, and a response time lengthened by an additional network hop. The gateway’s position can create a third: all calls go through it, and its unavailability can cut off access to all services. The same page provides for it to call services through a circuit breaker.

Example: an insurer’s customer area

Imagine a home insurer whose customer area exists as a website and as a mobile application. Policies, claims and payments are served by three separate services. The mobile application calls a single address, that of the gateway. The gateway checks the access token, applies the call quota set for the application, then routes the request. For the home screen, it queries the three services and returns an assembled response.

If the claims service is split in two, only the routing rules change: the mobile application does not have to be republished.

Where to place a gateway, how many to deploy, which business rules to keep out of it: these decisions fall within IT architecture, whose page details the integration rules.

FAQ

Frequently asked questions

Another question? Ask us

What is an API gateway?

An API gateway is a software component placed between client applications and the services they call. Clients address it alone: it receives their calls, routes them to the relevant service and can provide common functions, such as authentication or rate limiting. The notion is one of common usage: it is described by published architecture patterns and by vendor documentation.

What is the difference between an API gateway and a reverse proxy?

A reverse proxy is an intermediary server that receives requests in place of the application servers. The Microsoft Azure architecture documentation presents the API gateway as a component that acts as a reverse proxy, can handle cross-cutting tasks such as authentication or rate limiting, and can aggregate several calls. The same page cites reverse proxies such as NGINX and HAProxy among the ways of implementing a gateway.

What does the backends for frontends pattern refer to?

The backends for frontends pattern is a variant of the API gateway pattern described on the microservices.io website. A separate gateway is defined for each type of client, for example one for the web application, one for the mobile application and one for third-party applications. Each gateway exposes the API suited to its client.

Does a service mesh replace an API gateway?

The API gateway and the service mesh target different traffic. The API gateway receives the calls that come from clients and enter the application. The service mesh is an infrastructure layer, made up of network proxies, that manages exchanges between the services themselves. The two can be combined, and a mesh can provide its own ingress gateway.

A project to bring to completion?

A first conversation is enough to understand your challenge, identify the right people and tell you frankly what we can bring.