This is a read-only copy of the MariaDB Knowledgebase generated on 2025-05-01. For the latest, interactive version please visit https://mariadb.com/kb/.

Storage Engines Overview

Overview

MariaDB Enterprise Server features pluggable storage engines to allow per-table workload optimization.

A storage engine is a type of plugin for MariaDB Enterprise Server:

  • Different storage engines may be optimized for different workloads, such as transactional workloads, analytical workloads, or high throughput workloads.
  • Different storage engines may be designed for different use cases, such as federated table access, table sharding, and table archiving in the cloud.
  • Different tables on the same server may use different storage engines.
EngineTargetOptimizationAvailability
AriaRead-HeavyReadsES 10.5+
ColumnStoreAnalytics, HTAPBig Data, AnalyticalES 10.5+
InnoDBGeneral PurposeMixed Read/WriteES 10.5+
MemoryCache, TempTemporary DataES 10.5+
MyISAMReadsReadsES 10.5+
MyRocksWrite-HeavyI/O Reduction, SSDES 10.5+
S3CloudRead-OnlyES 10.5+
SpiderFederationSharding, InterlinkES 10.5+

Examples

Identify the Default Storage Engine

Identify the server's global default storage engine by using SHOW GLOBAL VARIABLES to query the default_storage_engine system variable:

SHOW GLOBAL VARIABLES LIKE 'default_storage_engine';
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| default_storage_engine | InnoDB |
+------------------------+--------+

Identify the session's default storage engine by using SHOW SESSION VARIABLES:

SHOW SESSION VARIABLES LIKE 'default_storage_engine';
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| default_storage_engine | InnoDB |
+------------------------+--------+

Set the Default Storage Engine

Global default storage engine:

SET GLOBAL default_storage_engine='MyRocks';

Session default storage engine supersedes global default during this session:

SET SESSION default_storage_engine='MyRocks';

Configure the Default Storage Engine

[mariadb]
...
default_storage_engine=MyRocks

Identify Available Storage Engines

SHOW ENGINES;

Choose Storage Engine for a New Table

Storage engine is specified at time of table creation using a ENGINE = parameter.

CREATE TABLE accounts.messages (
  id INT PRIMARY KEY AUTO_INCREMENT,
  sender_id INT,
  receiver_id INT,
  message TEXT
) ENGINE = MyRocks;

Resources

Engines for System Tables

Standard MariaDB storage engines are used for System Table storage:

FAQ

Can I use more than one storage engine on a server?

  • Yes, different tables can use different storage engines on the same server.
  • To create a table with a specific storage engine, specify the ENGINE table option to the CREATE TABLE statement.

Can I use more than one storage engine in a single query?

  • Yes, a single query can reference tables that use multiple storage engines.
  • In some cases, special configuration may be required. For example, Enterprise ColumnStore requires cross engine joins to be configured.

What storage engine should I use for transactional or OLTP workloads?

  • InnoDB is the recommended storage engine for transactional or OLTP workloads.

What storage engine should I use for analytical or OLAP workloads?

  • ColumnStore is the recommended storage engine for analytical or OLAP workloads.

What storage engine should I use if my application performs both transactional and analytical queries?

An application that performs both transactional and analytical queries is known as hybrid transactional-analytical processing (HTAP).

HTAP can be implemented with MariaDB Enterprise Server by using InnoDB for transactional queries and ColumnStore for analytical queries.

Reference

MariaDB Server Reference

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.