Overview
MariaDB is a MySQL-compatible relational database created by the original developers of MySQL. Zequel supports MariaDB through themysql2 driver (v3.11.5), leveraging full MySQL compatibility.
Supported Versions
- MariaDB 10.3+
- MariaDB 10.4+
- MariaDB 10.5+
- MariaDB 10.6+
- MariaDB 10.11+ (LTS)
- MariaDB 11.0+
- MariaDB 11.1+
- MariaDB 11.2+
Connection
Basic Connection
Connection String Format
MariaDB uses the same connection protocol as MySQL, so
mysql:// URIs work with MariaDB servers.SSL/TLS Configuration
Same as MySQL - supports all SSL modes:- Disable
- Prefer (try SSL, fallback to non-SSL)
- Require
- Verify-CA
- Verify-Full
Features
MariaDB inherits all MySQL features plus additional enhancements:MySQL-Compatible Features
- Tables, views, and stored procedures
- Triggers and events
- Indexes (BTREE, HASH, FULLTEXT, SPATIAL)
- Foreign key constraints
- Transactions with InnoDB
- Users and privileges
- Partitions
- Character sets and collations
MariaDB-Specific Enhancements
Sequences (MariaDB 10.3+)
Native sequence support as an alternative to AUTO_INCREMENT:System-Versioned Tables (MariaDB 10.3+)
Temporal tables with automatic history tracking:JSON Functions (MariaDB 10.6+)
Enhanced JSON support with table functions:Oracle Compatibility Mode
Optional Oracle SQL syntax compatibility:Storage Engines
MariaDB includes additional storage engines:- InnoDB (default) - ACID transactions
- Aria - Crash-safe MyISAM replacement
- MyRocks - RocksDB-based engine
- ColumnStore - Columnar storage for analytics
- CONNECT - Connect to external data sources
- Spider - Sharding and partitioning
Data Types
- Numeric
- String
- Date/Time
- Other
- TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT
- DECIMAL, NUMERIC
- FLOAT, DOUBLE
- BIT
Differences from MySQL
While MariaDB maintains MySQL compatibility, there are some differences:Advantages over MySQL
- Better performance in many workloads
- More storage engines (Aria, MyRocks, ColumnStore)
- Sequences as first-class objects
- System versioning for temporal tables
- Thread pool for better connection handling
- Faster replication with parallel slave threads
Compatibility Notes
- Most MySQL 8.0 features are supported in MariaDB 10.6+
- Some MySQL 8.0-specific features may not be available
- Binary replication between MySQL 8.0 and MariaDB requires testing
Version Detection
Zequel automatically detects MariaDB vs MySQL:Docker Development
Zequel includes MariaDB in Docker Compose:- Tables with various storage engines
- Views and stored procedures
- Triggers and events
- System-versioned tables (if supported)
- Sequences (if supported)
- Users and privileges
Best Practices
- Use Aria for non-transactional tables instead of MyISAM
- Enable thread pool for high-concurrency workloads
- Use sequences instead of AUTO_INCREMENT for distributed systems
- Consider system versioning for audit requirements
- Monitor with Performance Schema for query optimization
- Use utf8mb4 charset for full Unicode support