System Design Basics: API Gateway
Omar Ismail
Senior Software Engineer @ Digitinary | Java 8 Certified? | Spring & Spring Boot?????? | AWS? | Microservices ?? | RESTFul Apis & Integrations ?? FinTech ?? | Open Banking ?? | Digital Payments and Transformation??
Thanks to the original article : https://medium.com/geekculture/system-design-basics-api-gateway-6e3387698f92
API Gateway
An API gateway is an API management tool that sits between a client and a collection of backend services.
According to NginX, an API gateway takes all API calls from clients, then routes them to the appropriate microservice with request routing, composition, and protocol translation. Typically it handles a request by invoking multiple microservices and aggregating the results, to determine the best path. It can translate between web protocols and web?unfriendly protocols that are used internally.
An API gateway is the conductor that organises the requests being processed by the microservices architecture to create a simplified experience for the user. It’s a translator, taking a client’s many requests and turning them into just one, to reduce the number of round trips between the client and application. An API gateway is set up in front of the microservices and becomes the entry point for every new request being executed by the app. It simplifies both the client implementations and the microservices app.
Why is an API Gateway used?
An API Gateway serves the following functions:
API Management System
According to RedHat, API management refers to the processes for distributing, controlling, and analysing the APIs that connect applications and data across the enterprise and across clouds. The goal of API management is to allow organisations that create APIs or use others’ APIs to monitor activity and ensure the needs of the developers and applications using the API are being met.
领英推荐
It generally has the following capabilities:
Disadvantages of API Gateway
Kong vs Amazon API Gateway
Kong and Amazon API Gateway are two of the most popular API Gateways in the market.
AWS describes?Amazon API Gateway?as “Create, publish, maintain, monitor, and secure APIs at any scale”. Amazon API Gateway handles all the tasks involved in accepting and processing upto hundreds of thousands of concurrent API calls, including traffic management, authorisation and access control, monitoring, and API version management.
Kong?is detailed as “Open Source Microservice & API Management Layer”. Kong is a scalable, open source API Layer (also known as an API Gateway, or API Middleware) & is built on top of NGINX. Kong controls layer 4 and 7 traffic and is extended through Plugins, which provide extra functionality and services beyond the core platform.
Amazon API Gateway has an edge in terms of learning curve as it’s a fully managed service. It also fits very elegantly if you’re on the AWS ecosystem. Kong on the other hand is more open to customization as it’s open source and is easily integrated to plugins and additional layers both on L4 and L7. Both are very highly and closely rated on Gartner’s collection of reviews.
Conclusion
API Gateway is a valuable part of any architecture that has multiple microservices, different kinds of users and functionalities exposed to the outer world. It is vital in scaling your system, but can also act as bottleneck and single point of failure if not utilised correctly.
C#.Net | MAUI | Backend Developer | Microservice Architecture | Blazor Web Assembly | MSAL| Xamarin.Forms Developer at Eminent Technology
2 年You might consider using Event Orientedand Response Request approach.
Senior Software Engineer
2 年You might need a message broker, such as RabbitMQ, and include some strategy for rollbacks. Plus, you might need to implement some microservices patterns, for example Command and Query Responsibility Segregation (CQRS) pattern which separates the read and update operations.
Ingénieur DevSecOps chez Orange Cyberdefense. ## Docker and Friends (the tv show) Evangelist.
2 年Ousmane SOW