Where I can find MariaDB protocol document that different from MySQL
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Understanding MariaDB and MySQL Protocols
MariaDB and MySQL are both popular open-source relational database management systems (RDBMS) which share a common origin. They both stemmed from the structured query language (SQL) ideal of building robust database management systems. However, over time, both have diverged in their development, with certain features and functionalities distinct between the two. For developers or database administrators who intend to interact with MariaDB on a protocol level, understanding these differences can be crucial.
Protocol Overview
The core of any database interaction is the communication protocol it uses. Both MariaDB and MySQL initially shared the same protocol, but changes have been introduced in MariaDB that differentiate its protocol from MySQL's over time. The protocol of a database determines how data should be formatted and communicated between a client and the database server.
Finding the MariaDB Protocol Documentation
Official documentation for the MariaDB protocol can be acquired from the following resources:
- MariaDB Knowledge Base: This is the primary source of documentation and includes detailed explanations on MariaDB protocols.
- MariaDB Server Source Code: The protocol specifications can also be gleaned directly from the MariaDB source code distributions, which contain comments and documentation in the code that may provide further nuances.
- Repository: MariaDB Server GitHub
- MySQL to MariaDB Migration Guide: This guide helps you understand distinctive features if switching from a MySQL viewpoint.
Key Differences in Protocol
While the core protocol for both MariaDB and MySQL is similar, MariaDB introduces a few differences that users should be aware of when comparing it to MySQL:
| Feature | MariaDB Protocol | MySQL Protocol |
| Default Authentication | Uses mysql_native_password but started integratinged25519 | Typically uses caching_sha2_password |
| JSON Data Type | MariaDB uses JSON as a datatype but also extends its functionality | JSON datatype is supported |
| Encryption Capabilities | Offers table and tablespace level encryption | Supports only table level encryption |
| Compatibility with MySQL | Backward compatible with MySQL, but not forward | Compatible with earlier versions only |
| Protocol Extensions | MariaDB has unique commands and extensions like CONNECT, MICROSECONDS in time functions | Maintains traditional MySQL syntax |
| Plugin API | MariaDB has a different plugin API, a revised version to allow more flexibility and control | Uses MySQL Plugin API |
Technical Explanations
1. Authentication Plugin Changes:
While both databases use password exchange during authentication, MariaDB has introduced the ed25519 plugin for password exchange which is more secure than the mysql_native_password mechanism. Here is a basic authentication flow using MariaDB's native password:
2. JSON and Data Handling:
MariaDB's JSON is built directly upon its storage engine instead of being implemented as a binary format as seen in MySQL. This gives users flexibility when using JSON fields because they are less restricted and more portable across different storage engines.
3. Protocol Extensions:
MariaDB enhanced the query protocol with microsecond handling in time functions. For example:
This enhanced functional addition is invaluable for applications that require precise timing and timestamp accuracy.
Additional Considerations
When transitioning from MySQL to MariaDB or vice versa, it is necessary to:
- Compatibility Testing: Conduct compatibility tests for existing applications interfacing with these databases to spotlight any potentially breaking changes or deprecated features in the protocol.
- Update Client Libraries: Ensure that client libraries used for communication are updated to support any protocol changes adopted by MariaDB.
- Keep Abreast of Version Changes: Regularly consult the MariaDB release notes in the Knowledge Base to stay informed about updates in the protocol or new features in recent releases.
In conclusion, while differences exist between MariaDB and MySQL protocols, they tend to be subtle and are heavily documented. Properly understanding these distinctions will yield better performance optimization and feature utilization in your database endeavors. The resources provided will ensure you can access the complete MariaDB protocol documentation necessary for your needs.
Related reading
- Where to begin to learn Bloomberg's distributed DB Comdb2?
- WHERE vs HAVING
- Which annotation should I use IdClass or EmbeddedId
- Which data structures to use when storing multiple entities with multiple query criteria?
- Which database for a web crawler, and how do I use MySQL in a distributed environment?
- Which distributed SQL databases put data from different tables with the same tenant in the same node?
- Which is faster multiple single INSERTs or one multiple-row INSERT?
- Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM table, or SELECT COUNT

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.