In a word: is a reverse proxy tool, front-end applications and back-endserviceBetween acts as middleware to protect, such as authorization and traffic limiting.
The API gateway is the middle layer between the client and server, where all external requests pass first. In other words, the implementation of API considers more business logic, while security, performance and monitoring can be done by API gateway, which not only improves business flexibility but also does not lack security. The typical architecture diagram is shown in the figure:
2 Reverse proxy tools:
- Nginx
- Zuul
- Kong
Combined, the AWS API Gateway and other AWS services can be very powerful.
Background and advantages and disadvantages:
The reason for the emergence of API gateway is the emergence of micro-service architecture. Different micro-services generally have different network addresses, and external clients may need to call the interfaces of multiple services to complete a business requirement. If clients are allowed to directly communicate with each micro-service, the following problems will occur:
The client requests different microservices multiple times, increasing the complexity of the client. Cross-domain requests exist and are complicated to process in certain scenarios. Authentication is complex and each service requires independent authentication. It is difficult to refactor, and as the project iterations, microservices may need to be reclassified. For example, you might combine multiple services into one or split a service into multiple services. Refactoring can be difficult to implement if the client communicates directly with the microservice. Some microservices may use firewall/browser-unfriendly protocols, making direct access difficult. These issues can be addressed with API gateways.
The API Gateway handles all the tasks involved in receiving and processing up to hundreds of thousands of parallel API calls, including traffic management, authorization and access control, monitoring, and API versioning. The API Gateway acts as the “front door” to your application to pass through your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, any Web Application or real-time communication application) to access data, business logic, or functionality.
The advantages of using an API gateway are as follows: Easy to monitor. Monitoring data can be collected at the gateway and pushed to external systems for analysis. Easy to authenticate. Authentication can be done on the gateway and then requests can be forwarded to the back-end microservice instead of authentication in each microservice. Reduce the number of interactions between the client and each micro-service.