Search code examples
.netasp.net-coremicroservices

Microservices API gateway vs. Microservices Chassis


I am new to microservices, I heard about microservices chassis but I cant find enough resources online. I would like to know what is the difference between microservices chassis framework and API gateway because as far as I know chassis framework solves cross-cutting concern problems and some of them are already solved by API gateway .

is there any recommendations for a microservices chassis framework for .net ?


Solution

  • Cross cutting concerns: In any enterprise application, there are a number of concerns which need to be taken care of in addition to the main business logic. ... Such concerns are logging, transaction handling, performance monitoring, security etc. These concerns are known as cross cutting concerns of the application.

    To clarify this means that almost all micro-services has some common concerns. These concerns and how to manage them is Chassis. A microservice chassis is one such way to implement these cross-cutting concerns. Building a reusable chassis can help save time, enforce consistency across teams, and ensure that each service shares the same operational charateristics.

    API gateway has other role in microservices. After each service registers itself in discovery service, API gateway has to use discovery service to make connection between clients and each service.

    See this example:

    Micro service architecture

    The above example is from Spring implementation (Java).

    Imagine situation when each service is in different port and address. Then the client must know all the addresses and ports of each service to be able to call them. And what happens if any of them change? Everything is just ruined.

    To work around this problem, each service registers itself on a discovery server (in this example Eureka). API-Gateway then has to use that discovery service and create API addresses for each service. For example, it could forward any request in this pattern: /{micro_service_name}/** , to related registered service. This means if order-service has /orders/get/{order-id} API, then clients must use /order-service/orders/get/{order-id} to access an order. API-gateway uses discovery server to redirect the request to matching service.