4 Architecting IoT Cloud
223
Fig. 4.33 A typical
architecture of API gateway
API
gateway
Service 1
External
client
Service 5
Service 2
Service 3
Service 4
to the correct microservice. The API gateway generally manages requests by calling
on (invoke) several microservices and combining results. Indeed, the API gateway
provides a set of coarse-grained APIs for end users; however, behind the scenes, it
actually manages each request by utilizing a variety of services (an average of six
or seven fine-grained backend services). API gateway is also capable of translating
between different web protocols like HTTP or WebSocket protocols.
One of the main drawbacks of API gateway is that it should be highly available.
Therefore, it requires continuous development, deployment, and management,
raising the risk that it could become a development bottleneck. The API gateway has
to be updated in order to expose the endpoint for every microservice. The process
for updating the gateway should be as light as possible to ensure developers are not
left waiting. In light of both the positive and negative aspects of the API gateway,
most state-of-the-art applications make use of the API gateway.
4.7.1.2 Service Invocation
The components of a monolithic application call on (invoke) each other using
function calls or a language-level method while applications using a microservice
architecture function as a distributed system using many machines and inter-process
communication processes. Such mechanisms are grouped based on two specific
features. The first feature is related to client interaction styles [30]:
• One-to-One – Requests from the client are processed by a single service instance.
• One-to-Many – Requests are processed by several service instances.
The second feature is focused on whether the communication is synchronous or
asynchronous in nature:
Précédent

- 230/647

Suivant