InnoDB
InnoDB is the default storage engine for MySQL, starting with MySQL 5.5. It is a general-purpose storage engine that provides ACID (Atomicity, Consistency, Isolation, Durability) compliant transactions capabilities, along with features for data integrity and high concurrency.
Key Features:
- ACID Compliance: InnoDB ensures data integrity through its support for transactions, adhering to the ACID properties.
- Row-Level Locking: InnoDB uses row-level locking, minimizing contention and improving concurrency, especially in write-heavy workloads. Only the rows being modified are locked, allowing other transactions to access and modify other rows in the same table.
- Foreign Key Support: InnoDB supports foreign key constraints, which enforce referential integrity between tables. This helps maintain data consistency by preventing orphaned records and ensuring relationships between tables are valid.
- Crash Recovery: InnoDB is designed to recover from crashes reliably. It uses a transaction log to ensure that changes are either fully committed or rolled back in case of a failure.
- MVCC (Multi-Version Concurrency Control): InnoDB uses MVCC to provide consistent read views without blocking other transactions. Readers do not block writers, and writers do not block readers, enhancing concurrency.
- Clustered Index: In InnoDB, the primary key index is a clustered index, meaning that the data rows are physically stored in the order of the primary key. This provides fast access to data based on the primary key.
- Transactional DDL: Starting with certain versions of MySQL, InnoDB supports transactional DDL (Data Definition Language) operations. This means that schema changes are treated as atomic transactions, ensuring data consistency during schema modifications.
- Performance Optimization: InnoDB is designed for performance, with features like adaptive hash indexes, read-ahead, and write combining. It employs various optimization techniques to handle high-volume transactions and queries.
- Full-Text Search (Limited): InnoDB supports full-text indexing and searching, though its capabilities are generally considered less advanced than those offered by dedicated full-text search engines.
- Compression: InnoDB offers data compression capabilities, reducing storage space and improving I/O performance.