The API Gateway design pattern provides a single entry point for all client requests. It routes these requests to appropriate microservices as it is configured.

Other Features API Gateway provides routingauthenticationloggingrate limiting, and caching.

For example:- if our client application needs to connect with 10 to 20 services, it needs to remember the host and port URL for them, it’s not just a problem at the client side but also on the server side you need to implement authentication, authorization and security on each of those Microservices, API Gateway can solve many of these problems.

Without an API Gateway

  • We need to interact with APIs Directly which will lead to complexity and efficiency.
  • We expose our API publicly this will lead security issues.

In the Below example, we are not using API Gateway where we are directly exposing API.

With API Gateway.

Here we are using an API gateway where all requests are going through the API Gateway and then they are routed to specific APIs.

Features

  1. Routing
  2. Authentication
  3. Authorization
  4. Logging
  5. Rate limiting
  6. Caching
  7. Monitoring
  8. Load Balancing

What problem does API Gateway solve?

  1. Simplifying the client interaction with microservices.
  2. Centralized location for implementing such as logging, monitoring, and security
  3. Reduce complexity by hiding microservices implementation details.

reference :- https://microservices.io/patterns/apigateway.html

By Saineshwar

Microsoft MVP for Developer Technologies | C# Corner MVP | Code project MVP | Senior Technical Lead | Author | Speaker | Love .Net | Full Stack developer | Open source contributor.