O'Reilly logo

Understanding MySQL Internals by Sasha Pachev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. The Storage Engine Interface

MySQL provides a layer of abstraction that permits different storage engines to access their tables using the same API. In the past, this interface was called the table handler. More recently, the term storage engine was introduced. In the current terminology, storage engine refers to the code that actually stores and retrieves the data, while table handler refers to the interface between the storage engine and the MySQL optimizer.

The abstract interface greatly facilitates the task of adding another storage engine to MySQL. It was created during the transition from version 3.22 to version 3.23, and it was instrumental in the quick integration of the InnoDB storage engine, which brought in robust transactional capabilities, multi-versioning, and row-level locks. It can be used for integrating custom storage engines, which permits you to quickly develop an SQL interface to just about anything that knows how to read and write records.

The interface is implemented through an abstract class named handler, which provides methods for basic operations such as opening and closing a table, sequentially scanning through the records, retrieving records based on the value of a key, storing a record, and deleting a record. Each storage engine implements a subclass of handler, implementing the interface methods to translate the handler operations into the low-level storage/retrieval API calls of that particular storage engine. Starting in version 5.0, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required