API gateway pattern

  • An API gateway is programming that sits in front of an application programming interface(API) and acts as a single point of entry for a defined group of Micro-services.
  • Because a gateway handles protocol translations, this type of front-end programming is especially useful when clients built with micro services make use of multiple, disparate API’s.
  • Rather than hard coding different server URLs in different applications (web, iOS, android) which interact with the same set of services, we can just have the API gateway URL present in front facing apps.
    • API gateway will route concerned requests to corresponding Microservices.
  • Services in a micro service architecture work on different port’s.
  • API Gateway helps us to login once, and then authentication can be used for all services.
  • API Gateway helps us to configure common cross cutting concerns at one place.
  • We can have global authentication for all the services.
  • We can have a common port for showing all micro services which is the part of gateway.
    • We can define context path for each API/API Endpoint.
  • Multiprotocol Support can be provided by gateway(SOAP, JSON).
  • We can limit exposing all the endpoints
  • We can apply filter logic in API gateway.
  • Swiggy uses AWS API gateway pattern.
  • Some service providers which provide API gateway support are
    • Netflix Zuul
    • Spring cloud API gateway
  • An Example of Netflix Zuul can be found at Spring Implant: Microservices
  • An Example of Spring Cloud gateway is at following repos

No comments:

Post a Comment

Recursion

Q What do you understand by a Recursive  Programme? Recursion Is the process of repeating items in a self similar way. In programming langua...