It's hanging up! After reading the 527-page advanced notes on microservice distributed system development summarized by Ali P8 for 90 days, I made a green light all the way to the Java post of the big factory!

Must water at the beginning

Distributed systems are much more complicated than stand-alone systems, but after years of development, the industry has already had a wealth of distributed system theories and many excellent components. In the theory of distributed systems, the recently popular microservice architecture theory has become a leader, and the concept of microservices has become the mainstream in the current implementation of distributed systems. Obviously, microservice architecture has become a form of distributed systems. . The excellent distributed system components were mainly based on domestic Alibaba's Dubbo (now it has been incorporated into its incubator by Apache). Later, Spring Boot and Spring Cloud were introduced from abroad. They are now the mainstream solutions for microservice implementation.

In order to comply with the development trend of technology, I have conducted in-depth study and research on microservices, and in 2018 I created and published "Introduction to Spring Boot 2.x". Share the complete document for free, a total of 441 pages of private message [Learn] to get these two learning materials.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

In order to further explain microservices and meet the current needs of enterprises to build microservice systems, I did my best to write this book on Spring Cloud. Although Spring Cloud can have a dual P microservice system, the microservice system is only a form of distributed system. It cannot solve all the problems of distributed systems, such as distributed caching, sessions, databases and their transactions. None of them can be effectively processed by Spring Cloud. But these problems are also the difficulties and pain points that enterprises must face when implementing microservice systems. Therefore, on the basis of a detailed introduction to Spring Cloud, this book will also explain commonly used distributed technologies to meet the needs of enterprises.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

 

Content arrangement

Based on the actual application requirements of first-line enterprises, this book introduces Spring Cloud microservices and commonly used distributed systems. Overall, the book is divided into 4 parts.

Part 1: Overview and Basics (Chapters 1~2)

This part will explain the basic knowledge and concepts of distributed and microservices, and briefly introduce the basic knowledge needed in this book.

Chapter 1 Overview of Distributed and Microservices

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 2 Technical Foundation: In order to better introduce Spring Cloud, here is a little introduction-the REST style of Spring Boot and HTTP. Because Spring Cloud is based on Spring Boot, and each service system is integrated through REST-style requests, learning them will help us learn Spring Cloud in depth. Of course, if you are already familiar with them, you can skip this chapter and go directly to Chapter 3.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

 

Part 2: Spring Cloud microservices (Chapters 3~12)

Introduce various components of Spring Cloud, which is the core content of microservices. The components introduced include service registration and service discovery (Eureka), service invocation (Ribbon and OpenFeign), circuit breakers (Hystix and Resilience4j), gateways (Zuul and Gateway), configuration (Config), full link tracking (Sleuth), micro Service monitoring (Admin), etc.

Chapter 3 Service Governance-Eureka: The Pivotal team encapsulated the distributed system components developed by Nettlix through Spring Boot form of encapsulation, including Eureka, which is the service governance center of Spring Cloud. After using Spring Boot for secondary packaging, Bureka is very easy to use. As a governance center for microservices, Eureka is a service application that can receive registrations of other services, as well as discover and manage service instances.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 4 Client Load Balancing-Ribbon: Spring Cloud Netflix Ribbon is a client load balancing component. For convenience, it is referred to as Ribbon in this book. In the microservice architecture, we divide the system according to the business, but an actual business often requires multiple microservices to cooperate with each other to complete, so there are service calls between various microservices.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 5 Circuit Breaker-Hystrix: The Spring Cloud community recommends developers to use other open source projects that are still active. The most recommended one is Resilience4J, and the Spring Cloud community is also stepping up the development of spring cloud-ircuitbreaker to replace Hystrix. However, this project is still under development and has not been released. In addition, many companies are currently using Hystrix, and the technology is similar, so I decided to introduce Hystrix.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 6 New Circuit Breaker- Resilience4j : Resilience4j is a lightweight and easy-to-use fault-tolerant framework. It is inspired by Netflix's Hystrix and is designed based on Java8 and functional programming, so when you use it, you can See a lot of functional programming designs. It has several differences compared with Hystrix.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 7 Declarative Call-OpenFeign: From Chapter 3 to Chapter 6, this book introduces the core content of microservices: service governance, service invocation (Ribbon), and fuse (Hystrix and Resilience4j). These are all powerful tools for microservices, but from the developer's point of view, the ones we have dealt with most are service calls and fuses. Service invocation enables multiple microservices to call each other to serve the same business. The fuse can guarantee the service call to a large extent. But strictly speaking, it is troublesome to write Ribbon using the REST request method, and it is not friendly to developers. Therefore, on the basis of the REST request method, some developers also provide the call of the interface declaration method. For example, we will The introduced GitHub OpenFeign is like this.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 8 Old API Gateway—Zuul: In the previous chapters, we learned about service registration and discovery (Eureka). Through them, we can manage our services smoothly; we learned about the calls between services (Ribbon and OpenFeign), Connect each service to complete the business logic of the enterprise through joint assistance; also learned the circuit breaker (Hystrix and Resilience4j), which can protect the calls between microservices as much as possible, and avoid the avalanche caused by service dependence by fuse . The above mentioned are the core components of Spring Cloud microservices. At the beginning of this chapter, let us learn the last core component of microservices-API gateway. Netflix Zuul is an API gateway, its main function is to provide gateway services.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 9 New Gateway-Spring CloudGateway: In Chapter 8, we talked about the old Netlix Zuul gateway, and told readers that Zuul 1.x is just a gateway with average performance, plus Netlix Zuul 2.x version often cannot It was released as scheduled, so the new version of Spring Cloud does not plan to bundle Zul. The new version of Spring Cloud provides a new gateway for developers to use, this is the Spring Cloud Gateway. For the sake of simplicity, unless otherwise specified, it will be referred to as Gateway for short. Gateway does not use the traditional Jakarta EE Servlet container, it is developed using reactive programming. In Gateway, the Netty-based operating environment provided by Spring Boot and Spring WebFlux is required.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 10 Configuration- Spring Cloud Config: Spring Cloud Config (for convenience, when there is no ambiguity, the whole book is referred to as Config) is a project that supports microservices and distributed centralized configuration. There may be many instances in the microservice architecture. If you update the configuration one by one, the operation and maintenance costs will be very large. In order to simplify the complexity of configuration, some developers put forward the concept of centralized management configuration, that is, to provide a centralized configuration center, so that we can configure all microservice instances. The Config to be discussed in this chapter is designed for this purpose.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 11 Spring Cloud Sleuth Full Link Tracking: In the previous chapters, we learned about the Eureka Service Management Center, through which we can manage various services so that they can work together. But as the business becomes more complex, the service will become more complex, and each service can have multiple instances. Once a problem occurs, it will be difficult to find the root cause of the problem. In order to solve this problem, many distributed developers have developed their own link monitoring components so that requests can be traced to various service instances, such as Google's Dapper, Twitter's Zipkin and Alibaba. (Alibaba)'s EagleEye, they are currently well-known link tracking components.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 12 Monitoring of Microservices-Spring Boot Admin: In an excellent distributed system, it is very important to monitor service instances and discover problems in the instances in time. Spring Boot Admin provides such a function. For convenience and without causing ambiguity, Spring Boot Admin will be referred to as Admin for short below. Admin is a monitoring platform that can detect each Spring Boot application, allowing operation and maintenance personnel and developers to discover problems in each service instance in time. Admin is a console based on Spring Boot Actuator, that is, it can monitor the running status of each instance through the endpoints exposed by Spring Boot Actuator. Admin's User Interface (UI) is built using AngularJs applications.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

 

Part 3: Distributed Technology (Chapters 13~18)

Explain other distributed knowledge, including distributed number issuing machines, distributed databases, distributed caches, distributed sessions, and permissions.

Chapter 13 Generating a Unique ID-Number Issuing Mechanism: In the database (please note that in this chapter, unless otherwise specified, the databases mentioned are all relational databases, not including non-relational databases like Redis) In, the primary key is often the unique identification of a record, it is unique. In a stand-alone machine, only the problem of a single database needs to be considered, which is relatively simple, but in a distributed and micro-service system, it is relatively difficult, because it involves collaboration between multiple machines. So how to ensure that a unique ID is generated under multiple nodes in distributed or microservices, and how to make the ID have a certain readability? This requires a number issuing mechanism to control. How to implement the number issuing mechanism is the issue to be discussed in this chapter.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 14 Distributed Database Technology: As we talked about in Chapter 1, the increase in Internet membership and the complexity of business will inevitably lead to the storage of big data. At this time, the use of a stand-alone database for data storage and access becomes difficult. The division method is also discussed in Chapter 1, mainly horizontal, vertical and mixed division. For distributed and microservices, a business may have a lot of data, such as transactions. A single database may not be able to support it. Multiple database nodes are required to support it. This requires splitting the database into multiple nodes. The storage technology is the distributed database technology needed in this chapter. In order to better explain the knowledge of distributed databases, we first start with database knowledge such as sub-tables, sub-databases, and partitions. But in this chapter we will not discuss the related knowledge of distributed transactions, which will be discussed in the next chapter.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 15 Distributed Database Transactions: In the previous chapter, we discussed the knowledge of distributed databases, mainly sharding technology. In this chapter, let us discuss distributed database transactions. We know that in the world of the Internet, some data have very strict requirements for consistency, such as commodity inventory and user account funds, but these are most likely to be stored separately In different database nodes, how to ensure the consistency of these data in multiple database nodes is a problem to be solved by distributed database transactions.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 16 Distributed Cache-Redis: In the current Internet, the caching system is generally completed by Redis, so we will focus on Redis in the follow-up, and will not discuss other caching systems. This book uses the 5.0.5 version of Redis. If you use other versions, there will be a few differences in configuration items, but they are similar and will not cause major problems.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 17 Distributed Session: In a distributed system, there are multiple server nodes, and these nodes are even across services. If the session information is only on one node, a certain mechanism is needed to ensure that the session is in multiple services The nodes can be shared, which is convenient for the distributed session discussed in this chapter. In a distributed session, the most important function is security verification, because different users have different permissions.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 18 Distributed System Authority Verification: This chapter will talk about the authority verification of distributed system. In fact, the use of cache storage session (springsession-data-redis) mentioned in the distributed session can also support distributed authorization verification to a certain extent, but everything needs to start with the most basic Spring Security. Because there are many things involved here, I created a new project and named it chapter18 so that I can add corresponding modules as needed.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

 

Part 4: Practice of Microservice System (Chapter 19~20)

Explain remote procedure call (RPC) through Apache Thrift, and explain some common techniques for handling high concurrency in distributed, and finally give a microservice example.

Chapter 19: Remote Procedure Call : Remote Procedure Call (RPC) is a method of service invocation, and it has also been used in many enterprises. In fact, in microservices, it is recommended that we use REST-style calls instead of RPC. So why do you need to use RPC and how do you use it?

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Chapter 20 Microservice Design and High Concurrency Practice: The above chapters have explained most of the content of building microservices. This chapter mainly talks about microservice practices. In microservices, the big problem to be solved is high concurrency, which is also one of the most concerned problems in distributed.

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Because the contents of "Spring Cloud Microservices and Distributed System Practical Combat" and "Introduction to Spring Boot 2.0" are too much, the two books add up to a total of 971 pages, and there is no way to show them all. Those who need to get it can directly Scan below to get it for free!

Ali P8 explains the development of microservice distributed system based on enterprise needs. 527 pages of advanced notes

Guess you like

Origin blog.csdn.net/m0_46757769/article/details/109199521