If you have been following the MSCC - Mauritius Software Craftsmanship Community some weeks back, you would have noticed a forthcoming meetup on MariaDB and improved security features spoken by Joffrey Michaie from OceanDBA and Codarren Velvindron from the cyberstorm Mauritius. Thanks to Jochen Kirstätter (joki) founder of the MSCC who proudly sponsored the event.
Joffrey at the MariaDB meet up
Some craftsmans at the Meet up
Codarren explaining Glibc
Logan and me from hackers Mauritius
Codarren and me from hackers Mauritius
Can you spot where am i ?
Jochen. founder of MSCC
The first part of the presentation started with Joffrey who gave a brief introduction of MariaDB and the importance of its security features. He also laid heavy emphasis on the backup concepts that DBA need to go through. What are most interesting are that there seem two additional services that are coming on from OceanDBA - Backup as a Service and DB as a service.
Other points raised up concerning the importance of backups are to start a clustering solutions, to perform analysis and several tests on the Pre-production or staging servers. Database backups also need to be tested as there can be corrupted zip files. Another interesting issue raised up is about the locking table mechanisms during backups. Other backup strategy and concept were also explained such as:
- Cold backups - The downtime issues were raised up which according to me does not look practicable unless there is really a specific reason
- Hot backups - Usually carried out by the MySQLDUMP utility by everyone.
- Logical backups - Data that are usually backup as tables, views, indexes etc.. and they are mostly human readable statements. logical backups can be performed at the level of database and table.
- A tool that is completely new to me is the mydumper which can be used to backup terabytes of data. Some interesting arguments raised up are --lock-all-tables --skip-lock-tables and --master-data
- Binary backups - The binary backup which is the copy of the actual database structure and requires a file system or disk subsystem access. It is one the fastest method to backup and very compatible for mixed MYISAM and INNODB tables.
- HA (High availability) as the backup - Usually used in clusters and in Galera replication. However, to ensure that there is no data loss, a SAN replication was also recommended for data centers.
- Time delay replication - This was explained by taking an example, say a one hour delay backup based on the risk management that has been carried out.
- The Percona tools which can be used alongside MariaDB for backup Analysis.
On the second part of the presentation, Codarren lays emphasis on the security aspects concerning MariaDB in the context of whether to use Glibc or MUSL. Glibc libraries are used on mail servers, SQL servers, forms etc.. Back to the Glibc Ghost vulnerability, an explanation was given by taking a web-based form application where a particular field when filled with malicious information can be used to make calls to Glibc library with the intention to return a specific value. To re-mediate at that situation, same was patched using the function getaddressinfo() This patch lead to another vulnerability. Since today, we can deduce that though Glibc has gone through the various patch, yet, there are more bugs that have been discovered.
A solution was thus proposed to adopt the MUSL library infrastructure. We can see that the MUSL has a clean code policy compared to Glibc. Coddarren laid emphasis on the Alpine Linux operating system which is naturally based on MUSL. The size of Alpine compared to CentOS, Ubuntu, Debian are much smaller. Other issues raised are on the Grsecurity aspect which though is not widely spread are a very important aspect to take into consideration. MUSL looks to be very promising compared to GLIBC. Another analogy is taken from the Docker technology where companies are adapting Alpine Linux in the production environment to escape Glibc.
The third part of the presentation was continued on by Joffrey on the Galera clustering solution. An explanation is given using a schema how replication is being done at the cluster level. Several particular Database schemas were taken for example where a node with a cluster which is slow in terms of network or infrastructure issue where the other servers will have to wait for the request to reach its destinations. Other points mentioned are:
- Split brain in Galera where human interactions are needed especially where the ratio of the number of nodes have different data from other nodes within the same cluster.
- The importance of having applications built-in with retrying logic.
- Galera conflict diagnostic. For example cert.log which is used to log and monitor conflict transactions.
- Features such as auto-commit mode.
- Galera load balancing using Haproxy - custom monitoring on cluster size.
- MariaDB Maxscale which operate at layer 7 persistent connection.
- Maxadmin command line utility to list servers that are in the cluster
Jochen has also laid emphasis on future meetups and the proposal for members if they could find other suitable environments to carry out more interesting meetups in days to come. No one could deny that they have not learned anything. Indeed, the meet up was really interesting and fruitful. Some stickers were shared having the MariaDB logo which I have already pasted at the back of my Laptop 🙂