Explore the Inner Workings of a Powerful Database
MySQL’s source code is open in the sense of being publicly available, but unless you understand it, it’s essentially closed to you. In Understanding MySQL Internals (O’Reilly), Sasha Pachev, a former member of the MySQL development team, provides a comprehensive tour of MySQL 5 that reveals the inner workings of this powerful database. You’ll go right to the heart of MySQL to learn how data structures and convenience functions operate, how to add new storage engines and configuration options, and much more.
“I do not believe it is possible to understand and appreciate MySQL strictly through a conceptual discussion,” says Pachev. “On a high conceptual level, MySQL is very simple. It does not implement many revolutionary designs. It sticks to the basics. Why is it so popular then?”
The reason, he asserts, is that what makes a good database is not so much the concepts behind it, but how well they are implemented. As important as it is to be conceptually sound, a good portion of the genius is in implementing those concepts in a way that provides a reasonable combination of good performance and ease of maintenance. “In other words, the devil is in the details,” says Pachev, “and MySQL developers have done a great job of taking that devil by the horns and twisting his head off.
“Thus, in order to appreciate the inner workings of MySQL,” he continues, “You need to get close to the places where that devil is being subdued.”
Pachev’s book will lead you into those very places. Understanding MySQL Internals begins with a brief architecture overview that explains how the different components of MySQL work together. Next, you’ll learn steps for setting up a working compilable copy of the code that you can change and test at your convenience, and then you’ll work with basic frameworks for adding your own configuration variables (the controls of the server) and your own storage engine.
Other sections of the book cover:
Core server classes, structures, and API
The communication protocol between the client and the server
Configuration variables, including a tutorial and code for adding your own
Thread-based request handling and how threads are used in MySQL
An overview of MySQL storage engines
The storage engine interface for integrating third-party storage engines
The table lock manager
The parser and optimizer that execute SQL commands
Integrating a transactional storage engine into MySQL
The internals of replication
With descriptions of key data structures and methods not documented in the source code, Understanding MySQL Internals offers you unprecedented opportunities to learn about the inner workings of this enterprise-proven database. Whether you’re a developer, DBA, database application programmer, software vendor, or computer science student, this is your guide to discovering and improving a great database.