InnoDB Storage Engine Introduction
Contents
Overview
MariaDB Enterprise Server uses the InnoDB storage engine by default. InnoDB is a general purpose transactional storage engine that is performant, ACID-compliant, and well-suited for most workloads.
Benefits
The InnoDB storage engine:
- Is available with all versions of MariaDB Enterprise Server and MariaDB Community Server.
- Is a general purpose storage engine.
- Is transactional and well-suited for online transactional processing (OLTP) workloads.
- Is ACID-compliant.
- Performs well for mixed read-write workloads.
- Supports online DDL.
Feature Summary
Feature | Detail | Resources |
---|---|---|
Storage Engine | InnoDB | |
Availability | All ES and CS versions | MariaDB Enterprise Server |
Workload Optimization | Transactional | |
Table Orientation | Row | |
Default Row Format | Dynamic | InnoDB Row Formats InnoDB Dynamic Row Format |
ACID-compliant | Yes | |
XA Transactions | Yes | |
Primary Keys | Yes | InnoDB Primary Keys |
Auto-Increment | Yes | InnoDB AUTO_INCREMENT Columns |
Sequences | Yes | InnoDB Sequences |
Foreign Keys | Yes | InnoDB Foreign Keys |
Indexes | Yes | InnoDB Indexes |
Secondary Indexes | Yes | InnoDB Secondary Indexes |
Unique Indexes | Yes | InnoDB Unique Indexes |
Full-text Search | Yes | InnoDB Full-text Indexes |
Spatial Indexes | Yes | InnoDB Spatial Indexes |
Compression | Yes | Configure InnoDB Page Compression |
Data-at-Rest Encryption | Yes | |
High Availability (HA) | Yes | • MariaDB Replication • Galera Cluster |
Main Memory Caching | Yes | InnoDB Buffer Pool |
Transaction Logging | Yes | • InnoDB Redo Log (Crash Safety) • InnoDB Undo Log (MVCC) |
Garbage Collection | Yes | InnoDB Purge Threads |
Online Schema changes | Yes | InnoDB Schema Changes |
Non-locking Reads | Yes | |
Row Locking | Yes |
Examples
Creating an InnoDB Table
CREATE DATABASE hq_sales;
CREATE TABLE hq_sales.invoices ( invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, branch_id INT NOT NULL, customer_id INT, invoice_date DATETIME(6), invoice_total DECIMAL(13, 2), payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'), PRIMARY KEY(invoice_id) ) ENGINE = InnoDB;
SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA='hq_sales' AND TABLE_NAME='invoices'; +--------------+------------+--------+ | TABLE_SCHEMA | TABLE_NAME | ENGINE | +--------------+------------+--------+ | hq_sales | invoices | InnoDB | +--------------+------------+--------+
Resources
Architecture
- Background Thread Pool
- Buffer Pool
- I/O Threads
- Purge Threads
- Redo Log
- Row Formats
- Undo Log
Operations
- Configure Page Compression
- Configure the Buffer Pool
- Configure the I/O Threads
- Configure the Purge Threads
- Configure the Redo Log
- Configure the Undo Log
- Schema Changes
MariaDB Knowledge Base
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.