Microservices Gateway directory

      • 1. Introduction to microservices
      • 2. Use Nginx as the API gateway
      • 3. Self-made API Gateway (Repeat wheel)
        • 3.1. Build initialization
        • 3.2. Build middleware
      • 4, endnotes

1. Introduction to microservices

Congratulations, first of all, on entering the world of microservices. Microservices are a phase in the evolution of the architecture. They are characterized by the division of service types according to the level of business modules. Each service can be independently deployed and isolated from each other, and provides lightweight Api calls externally.

The design principles that microservices should follow:

  • Single responsibility principle: Each microservice only needs to implement its own business logic
  • Service autonomy principle: Each microservice is independent and does not depend on other modules
  • Lightweight communication principle: Http + Json is generally used
  • Interface specification principle: The interface should be more general and flexible to avoid changing interface parameters.

I started to contact the concept of micro-service in December 2017, and started to build the company’s micro-service platform. The system architecture is organized in the way of.NET Core WebAPI. With the increase of micro-services, there is an increasing need for a unified entrance to manage these micro-services.