Yunjuan Yunshu: Construction and splitting methods of microservices

The key factor in buildingcloud-native applications is to achieve decoupling of system modules to provide the prerequisite for cloud-native elasticity.

1. The development history of microservices

The development process of microservices is a process of effectively reducing costs and increasing efficiency, and it is a step of brave practice.

1. Follow the evolutionary steps of monomer-serverization-microservices-second-generation microservices

2. The business module provides services in the form of API to achieve decoupling.

3. Parallel development of multiple modules to improve function delivery efficiency

4. Improved availability and expansion flexibility provide a foundation for achieving high availability and scalability.

5. Service governance capabilities are decentralized and separated from the business, further allowing users to focus on business

2. Principles of microservice splitting

1. Conway’s Law

2. Two Pizza Theory

3. The Three Musketeers Principle

3. Microservice split strategy

1. Split vertically

The standard for servicing different functional modules and deploying and operating them independently is based on the degree of business correlation. Businesses that are closely related are suitable for splitting into a microservice, while businesses with relatively independent functions are suitable for splitting into a separate microservice. microservices

2. Horizontal split

From the perspective of public and independent functions, the standard is whether there are public functions that are called by multiple other services, and the dependent resources are independent and not coupled with other businesses.

4. Microservice splitting method

1. Split based on business logic: identify the business modules in the system according to their scope of responsibilities, and split each individual business module into an independent service

2. Based on scalable splitting: Sort the business modules in the system according to stability, and split frequently changing services at a finer granularity

3. Split based on reliability: Sort the business modules in the system according to priority, and then focus on ensuring the availability of core services

4. Split based on performance: Split modules with high performance requirements or performance bottlenecks to avoid services with high performance pressure from affecting other services.

Guess you like

Origin blog.csdn.net/bishenghua/article/details/135028820