Linux experts Seravo background Linux Debian SUSE
Linux-natives blog: Linux and open source – technology and strategy

What’s new in MariaDB 10.5 in Debian?

MariaDB 10.5 is the latest major stable release of MariaDB, released in the spring of 2020. It was imported into Debian.org in late summer 2020 by the author of this blog post. Debian is one of the most popular Linux distributions and the “mother” of many other distributions, most notably Ubuntu. Thus when MariaDB 10.5 was introduced in Debian’s official repositories, it automatically became also available in Ubuntu and many other Debian derivatives.

Debian and Ubuntu release engineering

Initially, any new package in Debian is available only in the unstable package archive, but that is eventually distilled into the testing package archive which then becomes the next stable release. MariaDB 10.5 was already released in Ubuntu 20.10 but that it will only appear in Debian 11 when released later in 2021. This means that, although MariaDB 10.5 has been out already for many months, the stage when all current Debian 10 users upgrade to Debian 11 and thus start using MariaDB 10.5 is still some time in the future.

To check what version is available in which distribution version, you can check packages.debian.org or packages.ubuntu.com. There is also the MariaDB 10.5 tracker page for a packaging status overview in Debian/Ubuntu.

MariaDB replaced MySQL in Debian since 2015

MariaDB is a database server made by the original authors of MySQL, including, among others, Michael “Monty” Widenius. MariaDB is actually a fork of MySQL and almost a drop-in-replacement for MySQL, and we recommend all MySQL users to migrate to MariaDB. There are many good reasons to do so, and Debian as a distribution opted for MariaDB in Debian 9, released in 2015. Ever since, all Debian users have been running MariaDB in all their MySQL-type use cases (for example when running WordPress).

MariaDB and MySQL in Debian timeline
Debian 8 shipped both MariaDB and MySQL. Since Debian 9 only MariaDB has been included.

Currently the latest Debian 10 shipped with MariaDB 10.3 and the next Debian 11 will ship with MariaDB 10.5. As there is a major new MariaDB release almost annually but Debian’s cadence is usually bi-annual, the MariaDB version 10.4 was skipped for Debian.

Compatibility with MySQL

Prior to 2013, the versions 5.5 of both MySQL and MariaDB were very similar to each other but over the years the differences have increased. It is possible to do an in-place upgrade from MySQL 5.7, 5.6 and 5.5 easily to MariaDB as MariaDB is almost fully backwards compatible on a binary format level with those versions of MySQL. However, starting from MySQL 8.0 there are major changes which prevents MariaDB from being binary compatible, but it is still logically compatible. This means that an in-place upgrade is not possible from MySQL 8.0, but you can dump a database from an instance of MySQL 8.0 and import it into an instance of MariaDB 10.5.

Oracle MySQL does not strive for any kind of MariaDB compatibility, so while you can upgrade from an older version of MySQL to a new MariaDB version, the other way around is not supported by Oracle.

Most apps (such as WordPress or NextCloud) work fine with both MariaDB or MySQL since those applications make use of any MySQL-only or MariaDB-only features.

What is new in MariaDB 10.5?

One immediately visible change is that starting from version 10.5, MariaDB has made most of its commands available using command names of form mariadb-*. For example the command mysqldump is now available also as mariadb-dump. Also, the server daemon itself is now running as mariadbd insteaf of mysqld. Keep that in mind when running ps faxu, for example!

Another naming change is that from this version onwards, the term REPLICA is a synonym for SLAVE in SQL statements. The new term was introduced in response to the political developments in 2020 in the US, where the use of black or slave in computer science lingo was viewed by some as an form of structural racism. These connotations are not in general shared by MariaDB developers, which of the majority live in Europe and which of many are also ethnically slavic (which is the origin to the word slave) and don’t associate the word slave with race, but because of US-centric power structures in the IT industry, MariaDB went along with the movement. To remain backwards compatible the old terms will continue to supported long in to the future.

A new storage engine S3 (packaged as mariadb-plugin-s3) makes it easy to archive selected tables into Amazon S3. Reading and writing to S3 is naturally slow compared to local storage, but this storage engine is not meant for daily usage but rather to transparently archive parts of a database so that they don’t consume disk space locally but can still occasionally be read and accessed.

On the performance side there are many enhancements such as:

  • InnoDB redo log format optimized to be faster and to need fewer log operations
  • Binary row logging is faster
  • Connect speed is faster (up to 25%)
  • New PCRE regex library version
  • New crc32 function
  • New performance_schema_* variables
  • Many small performance improvements across the code base
  • ANALYZE improved for easier visibility into query optimizer

On the security side of things there is a new configuration option require_secure_transport to force encryption in transit.

There are also two new JSON functions, JSON_ARRAYAGG and JSON_OBJECTAGG.

What is new in Galera 4?

Upgrading from MariaDB 10.3 to 10.5 also brings Galera 4 in multi-master clustered setups. Galera 4 uses a new WSREP API version 26 (while Galera 3 was using version 25). Some notable changes are that there is group commit support, a more lightweight SST lock to help make backups, and new metadata tables (wsrep_cluster, wsrep_cluster_members, wsrep_streaming_log). The new cluster state tables makes it very easy to list the connected nodes.

Watch DebConf20 presentation for more

For more details, watch the DebConf 2020 presentation about MariaDB 10.5 in Debian by Otto Kekäläinen on YouTube or PeerTube.

The slides are also available on SlideShare and SpeakerDeck.

MariaDB 10.5 and Galera 4 - State of MariaDB in Debian

Written by

Linux-natives – a blog by Linux experts from Finland – is brought to you by Seravo, a Finnish company focused on open source software and services.

Our team provides premium hosting and upkeep for your WordPress website - with open source software.

Leave a Reply

Your email address will not be published.