Choosing Between InnoDB and Aria in MariaDB
Decide whether to use InnoDB or Aria for a MariaDB table based on transactions, foreign keys, locking, and memory.
10 Aug 2026, 04:07 UTC

State the decision and constraints
When you create a table in MariaDB, you must choose a storage engine. That choice controls whether the table supports transactions, foreign keys, and row-level locking, and it shapes memory usage. Choosing the wrong engine can create data-integrity gaps or waste RAM.
Decision: select InnoDB or Aria for each new table.
Constraints:
- Does the workload require ACID transactions or foreign keys?
- Are writes high-concurrency, or mostly reads?
- How much memory can the server devote to the storage engine?
- Is the table general-purpose data or a temporary/intermediate result set?
This guide assumes MariaDB 10.6 or later. Older releases may have different defaults or engine availability.
Compare the supported engines
| Feature | InnoDB | Aria |
|---|---|---|
| Transactions / ACID | Yes | No |
| Foreign key constraints | Yes | No |
| Locking granularity | Row-level | Page-level |
| Crash recovery | Redo log and doublewrite | Crash-safe logs, non-transactional |
| Data organization | Clustered by primary key | Row storage, no clustered primary key |
| Typical use | General purpose, OLTP | Read-heavy tables, intermediate results, MyISAM replacement |
| Memory profile | Higher; uses buffer pool | Lower |
Trade-offs to weigh
InnoDB is the default general-purpose engine. Its clustered index stores rows in primary-key order, which makes primary-key lookups efficient. Row-level locking supports concurrent writes, and the redo log provides crash recovery. The trade-off is memory: InnoDB expects a sizable buffer pool, and under-provisioning it hurts performance.
Aria is a crash-safe replacement for MyISAM. It is optimized for read-heavy, non-transactional tables and is often used by MariaDB internally for intermediate query results. Page-level locking means concurrent writes to the same page can contend more than with InnoDB. Aria does not support transactions or foreign keys, so it is unsuitable for financial or relational data that must remain consistent across multiple statements.
Verify engine availability in your instance
Run this in the mysql client:
SHOW STORAGE ENGINES;
Where to run: any SQL client connected to the MariaDB instance.
Required permissions: none beyond a normal login; this is a read-only status command.
Expected check: the Engine column lists InnoDB and Aria, and the Support column shows YES or DEFAULT.
Risk: none; the command does not modify data.
Create tables and confirm the assigned engine
This example creates one transactional table and one read-heavy cache table:
CREATE TABLE sales_orders (
order_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
customer_id INT UNSIGNED NOT NULL,
total DECIMAL(12,2) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (order_id),
KEY idx_customer (customer_id)
) ENGINE=InnoDB;
CREATE TABLE product_search_cache (
cache_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
product_id INT UNSIGNED NOT NULL,
search_term VARCHAR(255) NOT NULL,
result_json JSON,
PRIMARY KEY (cache_id)
) ENGINE=Aria;
Where to run: the mysql client or a migration script connected to the target database.
Required permissions: CREATE on the target schema.
Confirm the result with:
SELECT TABLE_NAME, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'your_database';
Replace 'your_database' with the actual schema name. Expected result shows sales_orders as InnoDB and product_search_cache as Aria.
Risk: none for read-only verification; the CREATE TABLE statements create objects and cannot be undone without dropping the tables.
Validate transaction behavior
InnoDB should roll back a multi-statement transaction; Aria should not be relied on for that behavior:
START TRANSACTION;
INSERT INTO sales_orders (customer_id, total) VALUES (42, 99.00);
SELECT COUNT(*) FROM sales_orders WHERE customer_id = 42;
ROLLBACK;
SELECT COUNT(*) FROM sales_orders WHERE customer_id = 42;
Expected behavior for InnoDB: the count after ROLLBACK returns 0. Aria does not provide transactional rollback for user data; do not use it when undoing a failed multi-step operation matters.
Changing the engine on an existing table
Changing engines requires a full table rebuild:
ALTER TABLE sales_orders ENGINE=Aria;
This operation changes state. It needs free disk space roughly equal to the current table size and may block writes during the rebuild, depending on the MariaDB version and online DDL support.
Rollback path: restore from a backup taken before the change, or run another ALTER TABLE back to InnoDB, which also performs a full rebuild. Neither approach recovers data written to Aria after the change if Aria's non-transactional behavior lost it.
Limitations and final check
- Aria does not support ACID transactions or foreign keys.
- InnoDB consumes more memory because of the buffer pool; size
innodb_buffer_pool_sizefor your workload. - Engine changes on large tables are slow and storage-intensive.
After any engine decision or change, verify with:
SELECT TABLE_NAME, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'your_database';
Match the engine to the table's consistency and concurrency requirements before deploying to production.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.