preface

This book is an introduction to the MySQL database knowledge of professional books, from the core principles to the best practice, explaining the cobwebs, to talk, not only introduced from two aspects: the source code and operational MySQL most important concepts and operational key points, also tells the story of MySQL cluster components of outstanding Galera implementation principle and operational experience, at the same time, The design, implementation and function of the MySQL auditing system Inception are also introduced.

This book can not only serve as a reference for technical managers and architects in the design of mysql-related applications and systems, but also for MySQL application developers to better understand and use MySQL. Finally, as a necessary reference for MySQL DBAs, I hope it can be helpful to you in practical work.

MySQL Industry Salary

How to read?

The book is divided into three chapters

The first part is MySQL, including chapters 1 to 28. In this part, we introduce the concepts and principles of most common knowledge points of MySQL, as well as the operation and maintenance experience. Before the so-called source code, no secret. We start from MySQL source code, introduce the source code structure, start process, create a connection, table object cache, etc., hope readers in the study of MySQL, can make full use of MySQL source open source advantages, from the source code, in-depth understanding of the essence of MySQL.

Finally, it is worth mentioning that we also combined the various knowledge points, MySQL to ensure database security to do a more detailed summary, in the hope that this will change people’s opinion on whether open source database is reliable or not.


The second part is Galera. Galera is the technical basis of MySQL high availability for qunar architecture. After the preparation work is completed, It starts to tell the important knowledge points of Galera: verification method, message transmission, implementation principle of GCache, DETAILS of SST/IST, Donor/Desynced, concurrency control, FlowControl and disclosure of grastate. Dat file, etc. After reading these carefully, I believe readers will understand Galera to a new level.

Practice is another feature of this book, so Galera has also included many practical cases, such as the root cause of slow business update, manual cluster deadlock, migration from the library, etc., through these contents to share some of the work experience, I hope you can benefit from it.


The third part is Inception. Inception has been opened source. This book will describe an understanding of Inception, its significance and design concept.

We’ll cover its birth, installation, and use, as well as the supported options, result sets, and command sets. At the same time, it is worth noting that we have arranged an Easter egg for Inception, in which we describe several special features of Inception that have become an indispensable and important tool in our daily work.

Part I: MySQL chapter

MySQL contains 28 chapters in total:

Chapter 1~28 is about MySQL source code introduction, MySQL startup process, MySQL table object cache, InooDB preliminary exploration, InooDB data dictionary, InooDB data storage structure, InooDB index implementation principle, InooDB record format, MySQL fast delete large table, MySQL semi-synchronous replication, MySQL5.7 multi-threaded replication principle, Binlog timestamp, MySQL performance gap-pick, etc.

 

MySQL support for JSON document database is one of the most important innovations of MySQL in recent years. This technology enables MySQL to combine the advantages of NoSQL and relational database in one batch, so that MySQL users can embrace the new NoSQL technology without having to learn another set of new databases and adapt to unfamiliar new technologies.

On the other hand, DBAs can use the same tools as MySQL to back up, tune, monitor, and secure their databases. The development of MySQL makes IT easier for all MySQL practitioners to cope with the changes in the IT environment, benefiting MySQL application developers, DBAs and application business owners alike.

InooDB source code directory structure

We believe that as MySQL as a Document Store continues to improve, there will be more frameworks and ides that can support this technology stack, and MySQL will bring another high tide to the IT world after LAMP.

 

 

 

Part TWO: Galera

Galera contains a total of 14 chapters:

Chapter 29~43 studies the design and implementation of Galera Cluster, Galera parameter analysis, Galera validation method, Galera message transmission, GCache implementation principle, Galera flow control, Galera Cluster triggered by online table modification, etc.

 

The main purpose of Galera Cluster is to provide a consistent clustering solution for MySQL in the form of a Dlopenable library, and provide replication services through its own Write Set, so as to achieve the parallel and multi-threaded replication of MySQL and multi-source replication.

Validation based replication process

In addition, it has its own cluster node management mechanism, which can actively monitor cluster node status, automatically manage problematic data nodes, and realize multi-point write and smooth expansion of the cluster. Galera Cluster pays the most attention to data consistency. When dealing with transaction behavior, it either executes on all nodes or does not execute at all. Its implementation mechanism determines that it is very strict about consistency behavior, which can perfectly guarantee the data consistency of MySQL Cluster.

 

Part III: Inception

Inception contains a total of 9 chapters:

Chapter 44~53 covers Inception, Inception installation and use, support options, Inception backup rollback, parameter variables, command set statements, Inception egg, Inception design, etc.

 

Inception is an automated operation and maintenance tool for SQL statement auditing for MySQL. Inception will bring greater convenience to DBAs, freeing them from the chore of doing more automation, or researching architectures to ensure a higher degree of database availability, etc.

MySQL statement audit has been basically recognized in the industry, which is actually the unified standardization of MySQL statement writing. And according to this standard to do manual audit is actually very laborious, the more standards, the more tired the DBA, the more tired the development.

In this era of automated operations, auditing has to keep pace, and Inception was born.

Inception architecture diagram

Inception is far more than just an automated audit tool; it also has the capability to execute and generate a series of services that affect data with rollback statements (similar to flashbacks). This has made a huge difference in the DBA’s job, freeing the DBA from the passive situation of heavy auditing, connecting to MySQL Server execution, and making it difficult to roll back errors if there is no backup in advance.

Since Inception, I have suddenly realized how easy it is to be a DBA. The work is no longer repetitive, which saves a lot of time and gives me more free time to learn. This is a milestone for further development towards more intelligent direction such as the realization of an automated operation and maintenance platform.

MySQL Operation and Maintenance internal reference: MySQL, Galera, Inception Core principles and best practices