In 3 months, I have thoroughly understood the 528-page highly available and scalable microservice architecture recommended by Tencent T4 and successfully joined Sina

Preface

This article builds a microservice system through Dubbo, Spring Cloud, Service Mesh and other technologies, and introduces the development history of microservice architecture, domain-driven design, common methods of stability assurance, and consistency schemes for distributed transactions in a simple way. Case studies on micro-service landing solutions, such as active-active system construction, distributed monitoring, micro-service orchestration, design and implementation of micro-service gateways for tens of billions of traffic, micro-service transformation based on payment scenarios, etc., showing the complete realization of micro-service architecture Blueprint, and let readers understand how to use microservices to enhance and refactor existing legacy systems.

No matter if you are a newbie who has not heard of or new to microservices, a developer or operation and maintenance staff who is trying to use microservices to liberate productivity, or an architect determined to build a highly available and scalable microservice system, all It can be read, which is beneficial to readers.

In 3 months, I have thoroughly experienced the 528-page high-availability and scalable microservice architecture recommended by Ali P8, and successfully entered Ant

 

table of Contents

Chapter 1 micro Services Architecture Overview 1
1.1 What is architecture 1
1.2 several related concepts 3
1.3 From the software life cycle architecture design 7
1.4 9 form and characteristics of the architecture of
1.5 goals and methods of architecture 13
18 1.6 architecture, different styles
of Chapter 2 Microservice Domain-Driven Design 30
2.1 Domain-Driven Design 31
2.1.1 Overview of Domain-Driven Design 31
2.1.2 Problem Domain and Solution Domain 34
2.1.3 Bounded Context 35
2.1.4 Context Mapping 40
2.1.5 Domain Architecture 43
2.2 Design of
microservices 48 2.2.1 Boundary context 48
2.2.2 Bounded context is microservice 51
2.2.3 Recognizing bounded context 53
2.2.4 Cooperation between microservices 59
2.3 Summary 63
Chapter 3 Principles of Apache Dubbo Framework 64
3.1 Selection and use of
Dubbo framework 64 3.1.1 Selection of Dubbo framework 64
3.1.2 Use of Dubbo framework 65
3.2 Principle analysis of Dubbo framework 70
3.2.1 Analysis of overall architecture 70
3.2.2 Dubbo Bean loading 73
3.2.3 Dubbo Extension mechanism 77
3.2.4 Dubbo consumer 91
3.2.5 Dubbo server 126
3.2.6 Dubbo communication mechanism 144
3.3 Dubbo-based automated mock system 165
3.3.1 Mock simulation system generation 166
3.3.2 Dubbo Mock use 167
3.3.3 Principle Analysis of Dubbo Mock 168
3.3.4 Implementation of Automated Mock System 170
Chapter 4 Spring Boot/Spring Cloud Practice 177
4.1 Analysis of Spring Boot Principle 178
4.1.1 Spring Boot Quick Start 178
4.1.2 Spring Boot's Spring Application 180
4.1.3 Spring-boot-loaded module analysis 186
4.1.4 spring-boot-autoconfigure module analysis 190
4.1.5 Spring Boot Conditional annotation analysis 195
4.2 Dubbo Spring Boot Starter 198
4.2.1 Dubbo Spring Boot Starter introduction 198
4.2.2 Dubbo Initializr and sample 198
4.2.3 dubbo-spring-boot-autoconfigure module 201
4.2.4 dubbo-spring-boot-actuator module 204
4.3 Spring Cloud stack 211
4.3.1 Why does the microservice architecture need Spring Cloud 212
4.3.2 Overview of Spring Cloud technology stack 214
4.3.3 Spring-cloud-scaffold basic library collection 215
4.4 Scaffolding 239 based on Maven Archetype 239
4.4.1 Maven Archetype 239
4.4.2 Construction of scaffolding 240
4.4.3 Generating scaffolding 247
Chapter 5 Common methods for ensuring the stability of microservices 250
5.1 Stability of microservices 250
5.2 High availability 250
5.2. 1 Principle and Implementation of Current Limiting 250
5.2.2 Principle and Implementation of Circuit Breaker 256
5.2.3 Timeout and Retry 260
5.3 High Concurrency 262
5.3.1 Asynchronous 263
5.3.2 Cache 270
5.4 Summary 272
Chapter 6 How to Guarantee Transactions under Microservices 273
6.1 Evolution from local transaction to distributed transaction 273
6.2 Strong consistency solution 276
6.2.1 Two-phase commit protocol 276
6.2.2 Three-phase commit protocol 278
6.3 Final consistency solution 280
6.3.1 TCC model 280
6.3.2 Compensation model 285
6.3.3 Reliable event model 286
6.4 Interpretation of distributed transaction implementation of open source projects 288
6.4.1 Apache RocketMQ 288
6.4.2 ServiceComb 289
Chapter 7 of 10 billion traffic microservice gateway Design and Implementation 293
7.1 Overview of API Gateway 293
7.1.1 Distributed Service Architecture, Microservice Architecture and API Gateway 293
7.1.2 Definition, Function and Focus of
API Gateway 296 7.1.3 Classification and Technical Analysis of API Gateway 298
7.2 Open Source Gateway analysis and research 300
7.2.1 Introduction to common open source gateways 300
7.2.2 Comparative analysis of four open source gateways 308
7.2.3 Technical summary of open source gateways 309
7.3 Ten billion traffic trading system API gateway design 310
7.3.1 Ten billion Current status and problems of API gateways for traffic trading systems 310
7.3.2 Design and best practices of business gateways 313
Chapter 8 Microservice orchestration 317
8.1 Netflix Conductor 317
8.2 Netflix Conductor architecture 319
8.3 Conductor use cases 320
8.4 Netflix Conductor source code Analysis 328
8.4.1 Client layer source code analysis 330
8.4.2 Server-side source code analysis 337
8.4.3 Core-side source code analysis 344
Chapter 9 Microservice data extraction and statistics 356
9.1 Case stories 356
9.2 Data warehouse overview 358
9.2.1 What is a data warehouse 358
9.2.2 Data warehouse architecture 360
9.2.3 Data Warehouse Modeling Method 361
9.2.4 Data Extraction, Transformation and Loading 361
9.2.5 Data Statistics 362
9.3 Data Warehouse Tool Hive 362
9.3.1 Install Hive 364
9.3.2 Hive Database 366
9.3.3 Hive Table 367
9.4 Use Sqoop to extract data 369
9.4.1 Install Sqoop 370
9.4.2 Import MySQL table data into Hive table 372
9.5 ETL job scheduling 375
Chapter 10 Microservice active-active system construction 377
10.1 High system availability 377
10.2 Active-active data center 379
10.2 .1 Single computer room deployment 379
10.2.2 Dual computer room deployment 380
10.2.3 Active-active system construction
based on payment scenarios 383 Chapter 11 Microservice transformation and performance optimization based on payment scenarios 399
11.1 Introduction to payment scenarios 399
11.2 Payment business construction Module and service division 400
11.3 Detailed explanation and analysis of
microservice architecture in payment scenarios 402 11.3.1 Business architecture analysis 402
11.3.2 Detailed technical platform 404
11.4 Improving the performance of micro-service architecture from the code level 407
11.4.1 From the code and design perspective 407
11.4. 2 From the perspective of the overall architecture 418
11.5 Some common fault analysis techniques in the microservice architecture 421
Chapter 12 The microservice architecture transformation of the legacy system 426
12.1 The transformation of the code hierarchy 426
12.2 The bond and thinking of the legacy system 430
12.3 From the single Methodology of disassembling services in the whole system 431
12.4 Microservice architecture transformation of legacy systems 436
12.4.1 Starting from code refactoring 436
12.4.2 Splitting services requires service-oriented architecture design 437
12.4.3 Reconstruction is a gradual process 437
12.4 .4 Unit testing is the cornerstone 440
12.4.5 Design for failure 440
12.4.6 Separation of front and back ends 441
12.4.7 Sharing existing databases 441
12.4.8 The need for gray release 442
12.4.9 Log aggregation and full link monitoring 442
Chapter 13 Service Mesh Detailed 443
13.1 What is Service Mesh 443
13.2 The Background of Service Mesh 443
13.3 Introduction to Service Mesh 444
13.3.1 Service Mesh Architecture 444
13.3.2 What Service Mesh can do 445
13.4 Value of
Service Mesh 446 13.5 Current Status of Service Mesh 447
13.6 Problems Existing in Service Mesh 448
13.7 Detailed Istio 449
13.7.1 Istio Architecture 449
13.7 .2 Data Plane 450
13.7.3 Control Plane 455
13.7.4 Isito Case 458
13.8 Service Mesh Outlook 461
Chapter 14 Microservice Monitoring Practical Combat 463
14.1 APM Principle and Application 464
14.1.1 What is APM 464
14.1.2 APM Monitoring Point 464
14.1.3 APM in-depth analysis 464
14.2 Prometheus monitoring system introduction 492
14.2.1 The main features of
Prometheus 493 14.2.2 Prometheus architecture and components introduction 493
14.2.3 Prometheus installation 494
14.2.4 Using Prometheus to monitor MySQL 498
14.2. 5 Prometheus alarm mechanism 501

brief introduction

The book is divided into fourteen chapters:

Chapter 1: Overview of Microservices

Starting from the development process of software architecture, the evolution process of monolithic architecture, SOA architecture and microservice architecture is explained in simple terms. At the same time, it also introduces the characteristics of microservice architecture in depth. This chapter opens the microservices architecture from a macro perspective. The door to service.

Chapter 2: Microservice Domain Driven Design

This chapter introduces what domain-driven design is, what are the common domain architectures, how to apply domain-driven to microservices, and how to use domain-driven for reasonable service division, etc., to help readers practice their internal skills before formal learning microservices.

Chapter 3: Dubbo Principle and Implementation

At present, Dubbo has been re-maintained by the Alibaba technical team and has been vigorously developed and promoted. The use of Dubbo can still be used to build microservices. This chapter explains the use and skills of Dubbo in depth, as well as the in-depth analysis of the source code. Let readers have a comprehensive understanding of Dubbo's principle realization.

Chapter 4: Spring Cloud actual combat case

Spring Boot/Cloud is currently a more popular microservice framework. This chapter uses a large number of practical cases to explain to readers how to apply the Spring Cloud framework well and how to avoid pitfalls encountered during use.

Chapter 5: Commonly used methods to ensure the stability of microservices

As the business develops faster and larger, what we are faced with is how to ensure the stability of the microservice architecture when there are more and more services. This chapter leads the readers to gradually uncover the guarantee of stability The common skills and means.

Chapter 6: Consistency Guarantee of Transactions under Microservices

This chapter introduces the evolution from local transactions to distributed transactions, deeply analyzes the solutions of microservices in strong and final consistency scenarios, and discusses the two-phase commit protocol, three-phase commit protocol, TCC mode, and compensation mode , Reliable event mode, etc. At the same time, an interpretation of the distributed transactions of open source projects, including RocketMQ and ServiceComb.

Chapter 7: Design of 100-million-level microservice gateway

This chapter starts from the status quo and problems faced by the microservice gateway (API Gateway) of the tens of billions of traffic transaction system, expounds the relationship between the microservice architecture and the API gateway, straightens out the context of the traffic gateway and the business gateway, and brings the most comprehensive API gateway knowledge and experience.

Chapter 8: Microservice Orchestration

This chapter takes the Netflix Conductor framework as the core, introduces in depth what is microservice orchestration from the use and principle of the framework, and provides a new idea for microservices to execute complex business logic.

Chapter 9: Microservice Statistics and Data Extraction Scheme

Under the microservice architecture, there will be more and more services. In these cases, how to conduct data statistics and analysis will become very difficult. This chapter will explain in depth how to extract data from different service databases to a unified big data platform In, help users to more conveniently carry out data statistics.

Chapter 10: Construction of Microservice Active-active System

As the scale of enterprise development is getting larger and larger, users have higher and higher requirements for system stability, so the deployment of a single computer room will inevitably become the bottleneck of development. This chapter will lead the readers to start from scratch and start from the actual case in the same city. Living construction.

Chapter 11: Microservice transformation and performance optimization based on payment scenarios

This chapter starts from actual cases, in a specific payment business scenario, starting from a new project and gradually explains how to use domain-driven service division, how to use the microservice framework for service governance, and how to improve the performance of the microservice architecture after the project is completed.

Chapter 12: Microservice transformation of legacy systems

This chapter introduces the transformation of the microservice architecture of the legacy system, sorts out the transformation of the code layering structure, proposes a new code layering idea to deal with the popularity and popularization of microservices, and deeply considers the bonds of the legacy system, and discusses the monomer The methodology of system split service. At the same time, 9 practical core practical ideas are given for the solution of the microservice architecture transformation of the legacy system.

Chapter 13: Introduction and Cases of Service Mesh

With the continuous development of microservices, the next generation of microservice architecture has emerged. This chapter will introduce the development process of Service Mesh in depth, and lead readers to use Istio for specific practices based on specific cases.

Chapter 14: Microservice Monitoring Actual Combat

This chapter focuses on the principle of APM, develops the APM monitoring system from scratch, and also introduces the installation and principle of Prometheus, and how to use Prometheus for monitoring and early warning.

In 3 months, I have thoroughly experienced the 528-page high-availability and scalable microservice architecture recommended by Ali P8, and successfully entered Ant

 

This [Highly Available Scalable Microservice Architecture: Based on Dubbo, Spring Cloud, and ServiceMesh] has a total of 528 pages and has been organized and packaged. Friends who need the full version of the content can like this article and follow the editor. The direct train below is free Obtain

 

to sum up

Each chapter of this article is made by experts in related fields after years of technical accumulation and refinement. It is based on theory, with a large number of actual enterprise cases as the core, and comprehensively introduces the implementation methods of microservice architecture and the implementation process. The problems and solutions encountered are a technical book that combines detailed and "landable" theory and practice.

Guess you like

Origin blog.csdn.net/m0_46995061/article/details/108680946