I'm working on an enterprise project and I'm deciding to deploy an API gateway for the project. However, I noticed that many companies develop their own API Gateway instead of using existing ones like Kong, express-gateway, etc.
I'm wondering if is there any specific advantage in developing an API Gateway from scratch. Or any disadvantage in using existing ones?
Please note that we're deploying on our own infrastructure, not on the cloud.
CodePudding user response:
For this type of question, mostly answer is "It Depends".
There are certain thinking and analysis required.
- Purpose of API Gateway is not same across all project.
- Following are common purpose of API Gateway that available. (Most of them will have some of following feature)
- Routing Request
- Rate limiting
- Authentication
- Authorization
- SSL offloading
- Common header injection
- Request aggregation
- Response Caching
- Custom Business logic (*)
Steps.
- Identify purpose of Gateway in your project.
- Create list of feature you required.
- Is there any Gateway provide those feature ?
- What is cost of that gateway?
One common scenario with Microservices is that, It is fine grained and when it interaction happen with UI then there is some kind of agreegation or view model creation required. Sometime this is also vary based on client like Browser, Mobile client. In this situation Backend For Frontend implemented. It can replace API Gateway.