MariaDB basics: understand MySQL compatibility and storage engines
MariaDB is an open-source relational database server with shared ancestry and substantial compatibility with MySQL, but the projects evolve independently, so their features and operational behavior are not identical. When evaluating MariaDB or moving from MySQL, do not rely on “drop-in replacement” alone: check the target versions, client connections, SQL and data types, storage engines, backup/recovery, and replication needs. This guide follows official MariaDB documentation reviewed on 23 November 2026.
What is MariaDB, and how is it related to MySQL?
MariaDB Server receives SQL requests from clients and stores, retrieves, or changes table data. A mariadb command-line client or application connector connects, authenticates, sends SQL, and receives results. MariaDB’s official introduction describes backward compatibility and replacement for MySQL Server, but that is not a promise that every feature behaves the same. What is MariaDB? · Client/server protocol
The projects aim for compatibility across the protocol and many established SQL use cases, yet versions can differ in features, defaults, authentication plugins, system variables, and replication metadata. MariaDB’s protocol documentation describes MariaDB-specific capability extensions and says MySQL X Protocol is unsupported. A MySQL connector connecting successfully does not prove that every driver feature or SQL statement behaves identically. Protocol differences · MySQL–MariaDB compatibility matrix
Why do storage engines matter?
MariaDB has a pluggable storage-engine architecture, with the engine selectable per table. The server handles connections, SQL, and shared query work; an engine implements table data access and engine-specific features. Engines differ in transaction support, locks, indexes, crash recovery, and workload behavior, so the choice is about data guarantees as well as performance. Storage engine overview
InnoDB is a general-purpose starting point for transactional workloads, mixed reads and writes, and foreign keys. MariaDB documents it as the default engine in its standard server context and describes transaction, row-lock, and foreign-key support. ColumnStore is a separate option to evaluate for column-oriented analytical work. The MEMORY engine is volatile: its rows can be lost after a server crash. Defaults and available engines can vary by distribution, version, or configuration; check SHOW ENGINES and default_storage_engine on the actual server. Choosing a storage engine · Engine overview and checks
How do a query and engine work together?
This hypothetical shop example is illustrative and was not run on a MariaDB server:
CREATE DATABASE shop;
USE shop;
CREATE TABLE inventory (
product_id BIGINT PRIMARY KEY,
quantity INT NOT NULL
) ENGINE = InnoDB;
CREATE TABLE orders (
order_id BIGINT PRIMARY KEY,
product_id BIGINT NOT NULL,
quantity INT NOT NULL,
FOREIGN KEY (product_id) REFERENCES inventory(product_id)
) ENGINE = InnoDB;
SELECT order_id, product_id, quantity
FROM orders
WHERE product_id = 42
ORDER BY order_id DESC;The client selects shop and sends SQL. MariaDB Server processes the statement; ENGINE = InnoDB selects the engine for those tables. A foreign key checks that an order refers to an existing product, but it does not enforce the whole business rule “is enough stock available?” The application should update stock conditionally in a transaction, check the affected-row count, and insert the order only on success.
How do MariaDB transactions work?
MariaDB enables autocommit by default. Outside an explicit transaction, each modifying statement commits its own change. To group several steps as one operation, use START TRANSACTION or BEGIN, then COMMIT if all conditions pass or ROLLBACK if any step fails. Client APIs such as JDBC can also control transaction boundaries; avoid opening or ending the same transaction twice. START TRANSACTION, COMMIT, ROLLBACK
Conceptually, order handling might be:
START TRANSACTION;
-- Decrement stock only if the condition passes; the app checks affected rows.
-- Insert the order only after that check succeeds.
COMMIT;
-- If stock is insufficient or another step fails, use ROLLBACK.The comments describe application logic, not a complete executable procedure. Transaction guarantees depend on the storage engine. InnoDB changes can be rolled back; changes to nontransactional tables may remain. Do not assume one ROLLBACK atomically undoes writes across mixed engines. Transactions and engines
InnoDB’s default isolation level is REPEATABLE READ. Consistent reads in a transaction keep using the snapshot established at the first read. With READ COMMITTED, each consistent read can see a newer snapshot. Isolation changes which concurrent updates are visible and how locking works; a higher level is not automatically faster or the right choice. Check the actual global and session settings. SET TRANSACTION and InnoDB isolation
What should you verify before moving from MySQL?
Pin exact source and target versions, then check connectors and authentication, SQL and data types, table engines, transaction requirements, backups/restores, replication/GTID, and monitoring variables. The official compatibility matrix identifies examples of divergence, including JSON handling and GTID formats, for the version combinations it discusses. Treat those as version-scoped examples, not a universal rule for every release. Review release notes and test the complete application and operational procedures in an isolated environment. This article does not claim that a migration or compatibility test was performed. Compatibility matrix · MariaDB releases
Scope and sources
This is an introductory guide based on official MariaDB documentation reviewed on 23 November 2026. Installation, account security, tuning, actual migration, backup/recovery, and replication setup are out of scope. SQL examples are illustrative; no server or performance test was used.
[What is MariaDB?](https://mariadb.com/docs/general-resources/community/community/faq/mariadb-software-questions/what-is-mariadb)
[Client/server protocol](https://mariadb.com/docs/server/reference/clientserver-protocol)
[MariaDB protocol differences with MySQL](https://mariadb.com/docs/server/reference/clientserver-protocol/mariadb-protocol-differences-with-mysql)
[Storage engine overview](https://mariadb.com/docs/server/server-usage/storage-engines/storage-engines-storage-engines-overview)
[Choosing a storage engine](https://mariadb.com/docs/server/server-usage/storage-engines/choosing-the-right-storage-engine)
[InnoDB introduction](https://mariadb.com/docs/server/server-usage/storage-engines/innodb/innodb-storage-engine-introduction)
[START TRANSACTION, COMMIT, ROLLBACK](https://mariadb.com/docs/server/reference/sql-statements/transactions/start-transaction)
[Transaction isolation levels](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-transaction)
[MySQL–MariaDB compatibility matrix](https://mariadb.com/docs/server/server-management/install-and-upgrade-mariadb/migrating-to-mariadb/moving-from-mysql/mysql-to-mariadb-compatibility-matrix)