Experts recommend

Chief Technology Officer of PerfMa, most Valuable expert of TVP Tencent Cloud, consultant of China Commercial Union Think Tank

TongTingJian

This book is a theoretical and practical software architecture design guide, which aims to help readers complete the architecture design of high-performance software systems. The book covers theoretical knowledge of distributed, concurrent programming, database tuning, caching, IO, front-end performance optimization, and deduces practical skills based on theoretical knowledge. The book also uses the knowledge in the book to complete the architecture design of a real software project. This book is suitable for software architects, engineers and students to help them improve their knowledge system of software development and improve their ability of software architecture design.

In recent years, with the vigorous development of mobile Internet, digital economy has witnessed explosive growth. The Internet service of a hundred flowers has infiltrated into every aspect of people’s clothing, food, living and travel imperceptibly. The operation quality of software services has not only affected user experience, but also become a major event related to the people’s livelihood. From the information and digital era to the intelligent era, software system architecture is also constantly evolving, from the traditional single type, to SOA, then to micro services, and even the hot cloud native. While constantly driving business innovation by technological innovation, the technological challenges are also increasing day by day. For the Internet distributed system with high concurrency and heavy traffic, a small difference in technical solutions may lead to a huge difference in performance. The performance problem not only brings the increase of the operating cost, but also the hidden danger of the system stability.

Building high performance and high reliability software system is the unremitting pursuit of countless developers. However, software architecture design is highly dependent on theoretical knowledge system and engineering practice experience, if there is no appropriate learning channel, often slow progress. The author of this book has unique insights into software performance, and has rich experience in software architecture design and performance assurance. This book first stands on the theoretical height of systematization, starts from the characteristic dimension of software quality, deduces the measurement model of software performance, and answers the question “what is high-performance software architecture”. Combined with many years of experience, knowledge and skills to improve the performance of software architecture are introduced throughout the entire technology stack. Finally, a practical case is used to help readers fully digest and understand the knowledge learned. This is a good book for technology lovers and practitioners to read and learn.

Preface the author

In 2019, I published the “general source code reading guide – MyBatis source details” book, to share the source code reading related knowledge and skills. Books on the market, received a good response, some readers said learned a lot of programming knowledge, some readers said a thorough understanding of the source code of MyBatis, some readers said finally entered the source code reading door. The traditional version is also available in Taiwan, which makes every night I sit in front of my computer and play with my fingers worth it.

However, I also found that many developers lack systematic thinking when designing software architecture, and can only explore and improve through trial and error and summary, which is painful and slow. Moreover, this method of ascension tends to leave a knowledge blind spot. But these problems are difficult to read through the source to make up. Therefore, I decided to write a systematic architecture book to share with you. Books should not only contain theoretical knowledge, practical skills, and engineering solutions, but also connect these knowledge in a systematic way to help build a complete knowledge system. That’s why I wrote this book.

In this book, we will systematically introduce various aspects of high performance architecture from the point of view of high performance architecture. There is a lot of theory in the book, and I try to make it easy to understand with examples; There are many architectural techniques in the book, and I try to make them clear by summarizing them. At the end of the book, a high-performance distributed authority system will be developed based on the architecture in the book. From theoretical knowledge to architectural techniques to project practice, this book seeks to provide a complete body of knowledge to guide the architectural design of high-performance systems.

Chapter 1 introduces the concepts of high performance and architecture. This section describes performance indicators, architecture meanings, and main contents.

Chapter 2 introduces the shunting design. That is, how to use content distribution network, multi-address direct connection, reverse proxy and other means to disperse user requests to different systems, so as to reduce the concurrency of each system.

Chapter 3 describes the design associated with parallel services. First, the concepts of parallelism and concurrency are introduced. Secondly, cluster system, distributed system and microservice system are introduced. Including the characteristics of various systems, implementation difficulties and so on. Service parallel design can further distribute the requests within the system, thus improving the system performance.

Chapter 4 introduces the methods of concurrent operation such as multi-process, multi-thread and multi-coroutine, and gives corresponding examples. In particular, the common multithreading is deeply introduced, including thread state transition, application scenarios, use methods, cooperation methods and so on. Through the concurrent design of operation, the concurrent capability of the system can be significantly improved.

Chapter 5 introduces input/output design. Firstly, I/O classification dimensions and levels are introduced. Then, five common IO models are introduced in detail, including the evolution logic between these models, and practical examples of these models are given.

Chapter 6 introduces database design and optimization methods. Starting from the most basic design of relational database, this paper introduces the design paradigm and anti-paradigm of relational database design. On the basis of this, it also introduces the principle of various indexes, the use conditions, the characteristics of various locks, the generation and release of deadlocks, transactions and their isolation levels, etc. At the end of the chapter, we also introduce how to optimize databases for massive data storage, as well as some non-traditional databases and database middleware.

Chapter 7 introduces the methods and techniques of cache design. This chapter starts with the benefits of caching and deduces the methods to improve the benefits of caching. Then on this basis, the concrete implementation methods to improve cache revenue are given, including the design of cache elements, update mechanism, cleaning mechanism, risk point processing, location design, etc. Finally, it introduces the profit calculation and practice scheme of write cache.

Chapter 8 introduces the knowledge of system reliability design. First of all, the concept of reliability and specific measurement index are introduced. Secondly, the method of improving system reliability is introduced. This chapter will help us build highly reliable systems. Chapter 9 introduces the basic knowledge and practical means of applied protection. These knowledge and tools can improve the performance of applications in emergency situations.

Chapter 10 covers front-end performance. This is a relatively independent chapter. First, the performance key points in the front-end working process are analyzed. Secondly, the means of front-end performance optimization are given for these key points. It has strong generality and guidance.

Chapter 11 introduces the basics of architectural design style and software life cycle. This knowledge will guide our systematic approach to software architecture.

Chapter 12 is a project practice. Based on the high performance architecture knowledge introduced in previous chapters, this chapter introduces the architecture of a high performance software system, including theoretical derivation, model design, outline design, and detailed design, showing the readers a complete high performance architecture process. The content of this chapter will help readers learn how to apply the knowledge of the previous chapters flexibly in practice.

This book strives to combine theory with practice. It not only gives relevant theories and derivation of high-performance architecture, but also gives specific implementation strategies and skills. It also completes the architecture design of a high-performance software through project practice. Hopefully, after reading this book, you will have established a complete body of knowledge in the area of high-performance architecture.