Gateway Routing Pattern

In this article, we are going to talk about Design Patterns of Microservices architecture which is The Gateway Routing pattern. As you know that we learned practices and patterns and add them into our design toolbox. And we will use these pattern and practices when designing microservice architecture.

By the end of the article, you will learn where and when to apply Gateway Routing pattern into Microservices Architecture with designing e-commerce application system with following KISS, YAGNI, SoC and SOLID principles.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

Gateway Routing Pattern

Gateway Routing pattern is Route requests to multiple microservices with exposing a single endpoint. 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.

When the client needs to consume several microservices, Gateway Routing pattern offers to create a new endpoint that handle the request, And route this request for each service.

For example, an e-commerce application might provide services such as search Customers, Shopping cart, discount, and order history.

Solution

Basically, it put a gateway in front of a set of microservices and use application Layer 7 routing to route the request to the internal services. With this pattern, the client application only needs to know about and communicate with a single endpoint.

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 API Gateway Pattern.

So we should evolve our architecture with applying new microservices patterns in order to accommodate business adaptations faster time-to-market and handle larger requests.

See image that UI and MS communication are direct, and it seems hard to manage communications. We now we should focus on microservices communications with applying API GW pattern and evolving these architecture step by step.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

--

--

Mehmet Ozkaya
Design Microservices Architecture with Patterns & Principles

Software Architect | Udemy Instructor | AWS Community Builder | Cloud-Native and Serverless Event-driven Microservices https://github.com/mehmetozkaya