What is API Gateway?

What is API Gateway?
API Gateway is considered an extremely simple approach, acting as an intermediary connection between the client and the back microservice system.

What is API Gateway?

In the simplest way, API Gateway is an intermediary connection port.

This is the only gateway to the microservice system, receiving all requests from the client and performing actions such as editing - authenticating - directing them to each specific API on the backend services.

In addition, API Gateway is also considered as an interpreter and is responsible for streamlining the system.

API Gateway là gì?

Relationship between API Gateway and microservices system

A microservice system has an average of hundreds of different services.

Therefore, if the client side connects to the services in this system without any method, their communication diagram will look extremely complicated.

At this time, API Gateway appears as a perfect solution to make the communication between the client and the microservice system much simpler.

It can be said that implementing API Gateway for microservice-based applications is an extremely important issue, because this is seen as the only entry point to the system.

API Gateway combined with the microservice system helps create a simplified user experience.

API Gateway là gì?

Some pros and cons when applying API Gateway

Pros

  • Hide the structure of the microservice system from the outside.
  • Make the frontend code look neater.
  • Manage and track traffic in a simple way.
  • Helps reduce the risk of system overload.
  • Better system security, prevent attacks.
  • Can be used to authenticate users, as an alternative to authentication service.
  • Make the system simpler and more optimal.

API Gateway là gì?

Cons

  • Because it has to go through an intermediate server, the response will also be later than when calling directly to the system, causing a lot of time.
  • Managing API Gateway and handling errors is quite complex.
  • Without proper scale and config, API Gateway can be overloaded as well as cause bottlenecks and slow down the system.
  • Expensive for server and power source...

API Gateway là gì?