AB test It's a grayscale publishing method : Let some users continue to use A, Some users began to use B; If the user is right B There is no objection , Then gradually expand the scope , Move all users to B Up here . Gray level release can guarantee the stability of the whole system , It can be found in the initial grayscale 、 Adjustment issues , In order to ensure its impact .

The first 12 Chapter , Parameter passing
When communicating between service consumers and providers , In addition to the request parameters defined by the interface , Often you need to carry some additional parameters , For example, the message provider's IP Address 、 Trace of message call chain ID etc. ; These parameters cannot be passed through the business interface ,
The underlying distributed service framework is required to support this parameter passing method .

The first 13 Chapter , Service multi version
After the service goes live , With the development of business, the function needs to be changed , Or repair online BUG; After the service upgrade , It is often necessary to adopt multi version management for services .
Service multi version management is an important feature of distributed service framework , It involves the development of services 、 Deploy 、 Online upgrade and service governance .

The first 14 Chapter , flow control
When resources become a bottleneck , The service framework needs to limit the flow of consumers , Start the flow control protection mechanism . There are many strategies for flow control , More commonly used are : Static flow control for access rate 、 Dynamic flow control for resource occupancy 、 Connection control for the number of concurrent connections of consumers and concurrency control for the number of parallel accesses .
In practice , Various flow control strategies need to be used comprehensively to achieve better results , This chapter explains the flow control design principles and practices of distributed service framework .

The first 15 Chapter , service degradation
Big promotion or business peak , In order to ensure the of core services SLA, It is often necessary to stop some less important businesses , For example, product reviews 、 Forums or fan points, etc .
Another scenario is that some services are unavailable for some reason , But the process cannot fail directly , Local required Mock Server implementation , Let the process go . Take book reading as an example , If the user logs in, the balance authentication service does not work properly , Business release is needed , Record the consumption Bill , Allow users to continue reading , Instead of returning a failure .
The above two scenarios , All use an important service governance function of the distributed service framework : service degradation . Service degradation mainly includes fault-tolerant degradation and shielding degradation , Next, we will explain the strategy and design of two kinds of service degradation .

The first 16 Chapter , Service priority scheduling
When the current resources of the system are very limited , In order to ensure the normal operation of high priority services , Security services SLA, It is necessary to reduce the scheduling frequency of some non core services , Release some of the resources occupied , Ensure the overall smooth operation of the system .
There are many scheduling strategies for service priority , For a distributed services framework , You need to be able to set priority policies when publishing services , And when resources become a bottleneck , Schedule and execute the service according to the priority policy configured by the user .

The first 17 Chapter , Service governance
As the business grows , More and more services , How to coordinate various services running online , Security services SLA, It is a great challenge for service architecture and operation and maintenance personnel .
With the continuous expansion of business scale , Problems such as waste of small service resources are gradually emerging , Need to be able to call performance based on services KPI Data capacity management , Reasonable allocation of resources for each service , Improve the utilization of the machine .
When online business fails , It is necessary to downgrade the failed service 、 flow control 、 Traffic migration, etc , Fast business recovery .
As the development team expands , The online service is becoming more and more casual , It even happens to have the same function 、 Services with different service names are launched at the same time . It's easy to go online and difficult to go offline , In order to standardize the online and offline services , Before the service is released , We need to follow the service pre release process , The architect or project manager will review the release of services that need to be online , Only those who pass the audit can go online .
In order to meet the offline control of service 、 Ensure efficient online operation , There needs to be a unified service governance framework to unify Services 、 Effective control , Guarantee the efficiency of services 、 Healthy operation .

The first 18 Chapter , Distributed message tracking
With the development of business distributed architecture , System calls between systems are becoming more and more complex , Take the commodity purchase of e-commerce as an example , The purchase operation of the foreground interface involves hundreds of service calls to the bottom layer , The middleware involved includes :
◎ Distributed service framework
◎ Message queue .
◎ Distributed cache
◎ Distributed data access middleware
◎ Distributed file storage system
◎ Distributed log collection
◎ Its .....
If you can't effectively clean up the distributed calls and dependencies on the back end , Fault demarcation will be very difficult . Using distributed message tracking system can effectively solve the operation and maintenance challenges faced by the system after service , Improve operation and maintenance efficiency .

The first 19 Chapter , Reliability design
Compared with the traditional local Java API call , Cross process distributed service invocation faces higher failure risk .
1) Network failure : Link flashover 、 Overtime reading and writing, etc .
2) Serialization and deserialization failed .
3) Malformed bitstream .
4) Service call failure caused by server flow control and congestion protection .
5) Its He is abnormal .....
For applications , The distributed service framework needs to be robust enough , At the bottom of the platform, it can intercept and shield faults upward , The business only needs to configure fault-tolerant policies , High reliability can be achieved .

The first 20 Chapter , Microservice architecture
Over the past decade ,SOA ( Service-Oriented Architecture) Architecture has been widely used , Now? , With cloud computing 、 Mobile Internet 、Docker The rapid development and application of container and other technologies ,“ Microservices ” framework (Micro Service Architecture) This new architecture style has attracted more and more attention , More and more enterprises and platform service providers try and use it to solve specific business problems in practice , The popularity of microservice architecture has become one of the future technology development trends .

The first 21 Chapter , Service based best practices
Before service , Business is usually local API call , The performance loss of local method call is small . After service , Long distance network communication is adopted between service providers and consumers , Added extra performance loss , The delay of service call will increase , At the same time, due to network flash off and other reasons , The risk of distributed call failure also increases . If the service framework does not have enough fault tolerance , The business failure rate will increase significantly .
In addition to performance 、 Reliability and so on , Cross node transaction consistency 、 The difficulty of fault demarcation caused by distributed call 、 The increase of operation and maintenance cost of massive micro services is also a difficult problem that the distributed service framework must solve . In this chapter, we will analyze the challenges after service , And give solutions and business best practices .

secondly , Let's introduce the second section to you, which is —— Microservice design
======================
1. Catalog

2. primary coverage
The first 1 Chapter micro Services
With Domain Driven Design 、 Continuous delivery 、 On demand virtualization 、 Infrastructure Automation 、 Small autonomous team 、 The popularity of these practices in large cluster systems , Micro services also came into being . It was not invented , It's a trend or pattern summed up from the real world . But without the concepts mentioned above , Micro services are also difficult to appear . In the rest of the book , I will try to integrate these concepts , This gives an example of how to build 、 A panorama of managing and evolving microservices .
Many organizations find that fine-grained microservice architecture can help them deliver software faster , And more opportunities to try new technologies . Microservices give us great freedom in technical decision-making , Enables us to respond more quickly to inevitable changes .

The first 2 Chapter evolutionary architect
So far we can see , Microservices provide us with many choices , So we also need to make a lot of decisions . For example, how many different technologies should be used , Whether different teams should use different programming specifications , Should we merge multiple services or one - Split one service into multiple . How should we make a decision ? These architectures support changes at a faster pace in a frequently changing environment , Therefore, the role of architect needs to be changed accordingly . The view of this chapter on the responsibilities of architects is my personal opinion , I hope to launch a final attack on the definition in the ivory tower .

The first 3 How to model services
Now you know what microservices are , I hope you understand its main advantages . You may be eager to achieve it , Am I right? ? But where to start ? In this chapter , We will discuss how to determine the boundaries between services , To maximize the benefits of microservices , Avoid its disadvantages . however , First of all, we need to have a product as the carrier of discussion .

The first 4 Zhang Jiji
in my opinion , Integration is one of the most important technologies related to microservices - individual . Well done , Your microservices can remain autonomous , You can also modify and publish them independently : But if you don't do it well, it will bring disaster . I hope this chapter can help you in the journey of micro Services , Avoid having been in S
《 A big factory Java Analysis of interview questions + Back end development learning notes + The latest architecture explanation video + Practical project source code handout 》 Open source
OA The problems encountered in .

The first 5 Chapter decomposition of single block system
The previous chapters discussed what good services are and why small services can achieve better results , The importance of system evolvability is also discussed . But in fact , Maybe we already have a lot of code bases in our hands , Without exception, they do not follow the above model . How can we put - Break down a single block system ?
The formation of a single block system is not a day's work . Developers add new functions and new code to the system every day . After a while , It has become a terrible and huge existence in the organization , No one wants to modify it . But don't worry , It's not hopeless . As long as the right tools are used , We can hand blade this monster .

The first 6 Chapter deployment
The process of deploying a single block system is very simple . However, among many interdependent micro Services , Deployment is a completely different situation . If the method of deployment is not appropriate , Then the complexity it brings will make you very painful . This chapter will explain some skills and techniques , To help us ] Better deployment of microservices in a fine-grained Architecture .
I'll start with continuous integration and continuous delivery . These concepts are different from the topics we will discuss below , But it's related , 了 Understanding them can help us think about what to build 、 How to build and how to deploy , Make better decisions .

Last
Hand drawn as shown in the figure below kafka Knowledge outline flow chart (xmind The file can't be uploaded , Export picture presentation ), But you can provide source files to every friend who loves learning
版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211811479550.html