When software professionals encounter complex problems, they often face contradictions and struggle to find solutions. To overcome these challenges, it’s crucial to view tough problems as opportunities for significant rewards. Embracing difficult challenges can lead to valuable insights and breakthroughs.
With 20 years of problem-solving experience, most challenging problems in server-side software can be solved through systematic logical analysis. Despite its global prominence, MySQL faces a variety of problems. The journey in addressing these MySQL problems has enriched understanding and led to the development of unique insights, which inspired the writing of this book.
This book uses MySQL challenges as case studies to explore problem analysis and resolution strategies. Readers will gain a deeper appreciation for logical reasoning, data structures, algorithms, and more through practical examples and insightful discussions.
This book covers the following topics:
Focus of the Book:
Building on the goal of enhancing MySQL scalability, this book explores various optimization strategies to increase throughput, reduce response times, and ensure that MySQL secondaries closely match the performance of the primary server, thereby achieving high availability failover with very little delay in most scenarios.
Target Audience:
Part 1 focuses entirely on MySQL-related problems. Chapter 1 explores how users approach and solve challenging MySQL problems. Chapter 2 focuses on mysterious problems in MySQL 8.0.
Part 2 primarily covers the fundamental knowledge related to problem-solving. Chapter 3 emphasizes the importance of logical reasoning skills in addressing MySQL challenges effectively. Chapter 4 provides practical computer fundamentals essential for understanding MySQL problems. Chapter 5 introduces MySQL kernel basics, laying the groundwork for subsequent problem-solving discussions. Chapter 6 covers scientific methods for testing MySQL.
Part 3 primarily focuses on the analysis and improvement of specific problems. Chapter 7 highlights notable optimizations in MySQL 8.0. Chapter 8 examines improvements for solving problems specific to MySQL 8.0. Chapter 9 discusses enhancements in MySQL Group Replication, while Chapter 10 focuses on improvements in MySQL secondary replay. Together, these chapters not only boost MySQL performance but also lay the foundation for achieving a high availability cluster.
Part 4 primarily analyzes performance improvements from the perspective of MySQL users. Chapter 11 presents techniques to improve MySQL 8.0 application performance without code changes.
Part 5 is the concluding summary. Chapter 12 outlines future directions for MySQL improvements and concludes the book.
This book focuses on analyzing and solving MySQL problems, so a certain level of computer science background is recommended. To support understanding and maintain continuity, key terminology is included in the “Glossary” section of the appendix. For those lacking a foundation in MySQL, please refer to the related content in the appendix or consult dedicated MySQL books.
Balanced Replay Speed
For MySQL secondary replay, this defines balanced replay speed where the MySQL secondary matches the primary under normal circumstances. When the speed is at or below the balanced replay speed, there is no significant lag in transaction replay progress on the secondary. However, if the speed exceeds this threshold, the secondary begins to lag behind the primary in transaction replay progress.
Dual One
Specifically refers to two major configurations in MySQL: sync_binlog=1 and innodb_flush_log_at_trx_commit=1.
MySQL Secondary Replay
This term represents the common replay process for asynchronous replication, semisynchronous replication, and Group Replication. In this book, ‘MySQL primary’ is consistently used to represent the MySQL source, and ‘MySQL secondary’ to represent the MySQL replica.
When deploying MySQL for testing, it is preferable to match the test environment as closely as possible to the production environment, unless certain configurations significantly interfere with performance analysis. Below are specific declarations related to MySQL deployment during the testing process:
For configurations, patches, and additional information related to this book, please visit our webpage: https://github.com/enhancedformysql/.
Email wangbin579@gmail.com to comment or ask technical questions about this book.
This book meticulously organizes a wealth of ideas and knowledge contributed by numerous individuals, encompassing insights from both academic research and industrial practice. In computing, there is a natural inclination towards the latest innovations, yet our historical foundations offer valuable lessons. This book references dozens of articles, blog posts, documentation, and other resources, making it an invaluable learning resource for me. I am profoundly grateful to the authors for their generous contributions of knowledge.
Several individuals have been crucial in the writing of this book by reviewing drafts and offering feedback. I am especially grateful for the contributions of Hongshen Wang, Jinrong Ye, Riyao Gao, and Haitao Gao. Naturally, I take full responsibility for any remaining errors or contentious opinions in this book.
Finally, my deepest gratitude to my family, whose unwavering support has been indispensable throughout this nearly three-month writing journey. You are the best.