Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Administer a relational database: PostgreSQL and MySQL

  • 10 min

By updated

Improve this page

This training teaches you to run a relational database in production: set it up, control who connects to it, back it up and restore it, observe it, maintain it and replicate it. It is aimed at Linux administrators and SREs at an intermediate level who have never administered a DBMS (database management system). The common thread is PostgreSQL 18, and MySQL 8.4 LTS is offered as an option, with the same tasks. Every task is checked against a result you can observe yourself: a refused connection, a restore that matches the original, a measured replication lag.

Who is this training for, and what should you know first?

The training assumes two things you already know, and it does not teach them again. The first is Linux server administration: managing a systemd service, installing a package from a repository, reading the logs. The Linux training covers them. The second is the SQL language: reading a schema, writing a SELECT with a join, understanding a transaction. The SQL training (in French) teaches them on PostgreSQL, and nothing it covers is repeated here.

Other skills help without being required: remote access over SSH, disk management, the firewall and the basics of TLS. An observability training (in French) is recommended before level 2, because monitoring a database plugs into a chain of metrics and alerts that this training does not rebuild. To place the database building block in a complete system (transactions, critical state, backup, replication) before you administer it, read Relational databases: reading the building block that keeps critical data (in French).

How is the training organised?

The training opens with a fundamentals module that applies whatever the engine: the lesson Data modeling teaches you to design a model (entities, cardinalities, keys, normal forms) before you choose an engine, because a design mistake is paid for afterwards in every query.

Three levels then follow one another, each with a result you can check. Level 1 has you put a safe database into service: install the engine from its vendor's repository, connect to it through the local socket and over the network, make the memory, connection and log settings effective, then close the accesses (authentication rules, least-privilege roles, TLS enforced). This level currently ends on hardening the accesses: it has no closing step yet with a restored backup, because the logical backup lesson is not attached to the training (see the box above).

Level 2 teaches you to protect and operate: physical backup and log archiving up to point-in-time recovery (PITR), monitoring of sessions and expensive queries, and maintenance (reclaiming the dead space left by outdated rows, keeping statistics and indexes up to date). Level 3 has you replicate and fail over: stream a standby (a copy that follows the primary continuously), measure its lag, promote it when the primary goes down, then bring the old primary back.

Three orientation lessons, with no administration task, serve as waypoints: the first, which follows the fundamentals and comes before level 1, has you choose a relational engine; the second (to come) will set out the backup policy before level 2; the third (to come) will cover high availability before level 3.

PostgreSQL or MySQL: which option should you follow?

The default path is PostgreSQL 18. It carries the lessons, the hands-on lab work and the assessments to come. The lessons of the MySQL 8.4 LTS option repeat the same tasks, engine by engine: discover InnoDB (MySQL's storage engine), configure, control accounts, back up, monitor, replicate. They are optional and flagged as such in the course outline.

Both engines have their labs. The repository publishes 17, all validated: nine for PostgreSQL and eight for MySQL, including a level 1 end-of-level exam graded on the real state of the server. The practice is therefore the same whichever engine you choose. If your job requires MySQL, follow the MySQL option; if you have no constraint, follow PostgreSQL. The lesson on choosing an engine gives the criteria that separate the two, as well as SQLite.

Where do you practise?

The tasks are practised on three Debian 13 virtual machines (db1.lab, db2.lab, db3.lab), using the bdd-dsoxlab-training lab repository. A virtual machine rather than a container, because putting a database server into service also means touching systemd, disks and the network, which only a full machine reproduces faithfully. Three machines are needed as soon as you move on to replication, which requires a primary and at least one standby.

These labs are linked to the lessons as they are rewritten. On the PostgreSQL side, the installation, connection, configuration, hardening, monitoring and replication lessons each carry theirs. On the MySQL side, these are the connection, configuration, hardening, backup, monitoring and replication lessons, plus the level 1 exam on the module introduction, and the installation tutorial carries one too. Three PostgreSQL labs (backup, archiving, point-in-time recovery) are not yet cited by any lesson of the training: they can be followed from their repository. The training does not count them in its progress.

What does this training not cover?

This training deliberately stays within the relational server, and it sends elsewhere whatever belongs to another job or another platform.

  • Writing queries and optimising them: that is the SQL training, which also covers index design and reading a plan with EXPLAIN. Here, you tune the server and maintain existing indexes, without rewriting the queries.
  • Managed cloud databases: they have their own module in the Cloud training, because neither the system nor the backups are administered the same way there.
  • NoSQL, vector databases and search engines: these are not relational databases. NoSQL databases (in French) are placed within their architecture, and vector databases (in French) have their own reference page.
  • Kubernetes (CloudNativePG), partitioning, sharding (Citus, Vitess) and MariaDB with Galera: another platform, another audience, or an engine that has diverged from MySQL.
  • SQLite: nothing to administer on the server side, the SQLite guide (in French) is enough.