Microservices

Gateway Routing Pattern-Microservices

Gateway Routing pattern is Route requests to multiple microservices using a single endpoint.

Setting up and managing each endpoint for backend service, that clients can consume can be challenging. When the API changes, the client must change as well. 

For example, an e-commerce application might provide services such as search, reviews, cart, checkout, and order history. Each service has a different API that the client must interact with, and the client must know about each endpoint in order to connect to the services.

If any API changes, the client must be updated as well. If you refactor a service into two or more separate services, the code must change in both the service and the client.

This pattern is useful when we want to expose multiple services on a single endpoint and route them to internal backend microservices based on the request.

To handle this, we are going to use Gateway and an application Layer 7 routing to route the request to the appropriate instances.

If any internal service is changed, the client does not necessarily require updating. It can continue making requests to the gateway, and only the routing changes. So this pattern is the ancestor of the API Gateway Pattern.

Gateway Routing Pattern
Issues and considerations to be Known:
  • The gateway service may introduce a single point of failure. Ensure it is properly designed to meet your availability requirements. Consider resiliency and fault tolerance capabilities when implementing.
  • The gateway service may introduce a bottleneck. Ensure the gateway has the adequate performance to handle the load and can easily scale in line with your growth expectations.
  • Perform load testing against the gateway to ensure you don’t introduce cascading failures for services.

Note: This pattern may not be suitable when you have a simple application that uses only one or two services.

Please refer Microservices link to know more about microservices Design patterns.

Loading

One thought on “Gateway Routing Pattern-Microservices

Comments are closed.

Translate »