What is an API Gateway?

API gatewaysprovide a single point of entry into a system with multiple APIs or multiple microservices that communicate with each other through APIs. The API gateways are of great interest in theœof an API management system (API management), and therefore the intermediate layer between the microservices and the client applications that need the microservices to function. The role of these API gateways is to direct API traffic and to connect microservices and client applications.

There are two typical uses of APIs gateways:

  • Service to service
  • External traffic to aningress service

The development of API gateways should be seen in the more general context of the APIsation of companies and the adoption of of microservice architectures as opposed to SOAor Service-oriented Architectures. The multiplication of APIs to link services together is a service to companies and IT departments. But it has also created an additional complexity that is the management of the communication between these services and therefore the management of the APIs themselves.

To put it simply, in a microservices architecture, the various specialized microservices communicate with client applications through APIs. The API gateways are used to manage the traffic generated by the APIs.

 

What is the benefit of using APIs Gateways?

If your project is managed in microservices, then the interest of an API gateway lies in the way it centralizes the type of architecture. As such, it allows you to vary the scale of service use and adapt the architecture to the load being submitted.

In a microservices architecture, client applications generally need to use the functionality of more than one microservice and thus make several simultaneous calls API CALLS. When the microservices project evolves, either to introduce new microservices or to update one or more microservice(s), managing the API calls from the client application can quickly become too complex. In this case, API gateways are in this case an intermediate management tool between the microservice and the client application.

On June 3, 2020, we published an article about APIsation in the digital insurance world.

4 recurring problems related to the absence of an API gateway

The advantage of an API gateway is that it avoids many problems :

  • Communication problems between the client application and the microservicein order to adapt the changes of the microservice to the client application, it is necessary to perform maintenance. This maintenance can be very complex because of the multiplication of microservices used by the client application, and therefore the multiplication of the necessary maintenance operations.
  • The multiplication of requests: it leads to back and forth between the client application and the microservices. A single page displayed on the client side can send several requests to different microservices, thus increasing the latency of the application and in fine the display time of the final rendering to the client. API gateways typically act as intermediaries and optimize the performance management of the requests sent.
  • Security issueswithout API gatewaygateway, the microservices of an architecture are exposed to potential malicious third parties. Using an API gateway makes it possible to hide microservices that are not directly used by the client application and therefore reduces the number of microservices "attackable".
  • No transverse mutualization between microserviceseach microservice used by the client application must request its own authorizations, have its own SSL certificate, etc. What could be handled in one go by using an API gateway requires several requests to be processed.

What are the potential risks of using API gateways?

Most of the concerns about using API gateways are actually related to the adoption of the microservices architecture itself. The use of microservices is certainly more complex than an SOA, but has many advantages in terms ofs development and maintenance.

À At a more micro level, the use of an API gateway requires the management of an additional complexity which is the coupling of the gateway with the microservices in question. This can result in a longer response time for the client application due to the additional network call to this intermediate layer.

The case remains nevertheless marginal: in most cases, this call from the client application to the gateway will have less impact than the multitude of calls from the client application directly to the required microservices. The scaling of the gateway can also be a limiting factor. If the gateway is not robust enough, it can be a bottleneck between the microservices and the client applications.

Are you convinced of the benefits of installing an API gateway? To avoid these pitfalls, BlueSoft will help you set up your IT projects and demonstrate its expertise in the use of API gateways and microservices.

Share this article!