What are API Gateways ?

API Gatewaysoffer a single point of entry into a system comprising several APIs or several microservices communicating with each other via APIs. API Gateways are of particular interest in theœof an API management system (API management), and therefore the intermediate layer between microservices and client applications that need microservices to function. The role of these API gateways is to direct API traffic and link microservices and client applications.

There are two typical uses for API 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 via APIs. API gateways manage the traffic generated by these APIs.


Why use 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 on APIsation in the digital insurance world. Discover the 4 essential steps to choosing and implementing an API.

4 recurring problems linked to the absence of API gateways

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.
  • Safety issueswithout API gatewaysgateways microservices 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, thus reducing 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 the additional complexity of coupling the gateway with the microservices in question. At the client application level, this can result in a longer response time due to the additional network call to this intermediate layer.Here are a few API rules to be observed.

The case nevertheless remains marginalin the majority of cases, this call from the client application to the API gateways will have less impact than the multitude of calls from the client application directly to the required microservices. Gateway scaling can also be a limiting factor. If the gateway is not sufficiently robust, it can become a bottleneck between microservices and client applications.

Are you convinced of the benefits of installing an API gateway? To avoid these pitfalls, Blue Soft can help you set up your IT projects, and has in-depth expertise in the use of API gateways and microservices.

Read also: APIs: Necessary to perfect the user experience?

Share this article!