Grain Mall Study Notes (3): Introduction - Project Microservice Division Diagram

1. Microservice partition diagram

Please add a picture description

2. Separation of front and rear ends

This project is based on the separation of front-end and back-end development, and some front-end projects need to be created. admin-vue is a background management system for staff , and shop-vue is a web site system for public access . Of course, there can also be apps, small programs, etc.

3. Gateway

First of all, the request passes through the gateway from the front end to reach the microservice group of the business. This gateway can also complete some other tasks, such as: current limiting, fuse downgrade , etc. After the request reaches the microservice group of the business, these businesses will be processed. Of course, there can be more other businesses. The businesses listed below are the businesses we want to write.

4. Business microservice group

  • Commodity service: product off-shelf, commodity addition, deletion, modification, etc.
  • Payment service: integrated payment function
  • Preferential service: product-related preferential information
  • User service: user's personal center, user's sales address list, etc.
  • Warehousing service: Where is the data stored in the warehouse?
  • Order service: complete order-related functions, and complete some additions, deletions, changes, and queries.
  • Retrieval service: Use ElasticSearch for full-text search service.
  • Central authentication service: use it to log in and register
  • Shopping cart service: add, delete, modify and check items in the shopping cart, checkout through the shopping cart, etc.
  • Independent background management system: If you want to add some discount information or add some products through the background, the background management system will also send corresponding requests to the corresponding services

5. Third-Party Services

During the writing of the service, it may depend on some third-party services, such as: logistics, SMS, finance, identity authentication, just call their interfaces directly

6. Service Governance

During the governance of microservices, how to make them run in an orderly and robust manner?

  • Use Nacos as the registration center
  • Use Nacos as the configuration center
  • Seata to do distributed transactions
  • Sentinel is used for service fault tolerance.
    These components are provided by Alibaba SpringCloud.

The four components of Feign, Gateway, Sleuth, and Zipkin are provided by SpringCloud.

7. Status monitoring

For status monitoring of the entire application, use prometheus, Grafana

8. Data layer

  • The data layer uses Redis as a cache
  • Use MySQL for persistence
  • Use ShardingSphere to help MySQL do database and table operations
  • Use RabbitMQ as a message queue
  • Use ElasticSearch for full-text search
  • Use Alibaba Cloud's object storage to store related static files such as pictures and videos.

9. References

Guess you like

Origin blog.csdn.net/e2788666/article/details/131100221