LinuxAlternative
MariaDBLinux vs PostgreSQLWindows

MariaDB, alternative Linux à PostgreSQL

Mis à jour le

Notre avis

MariaDB can handle many of the same workloads as PostgreSQL, but it is not a drop‑in replacement for all use cases. It works well for applications that need a relational database with ACID compliance, built‑in replication, and a large community, especially when the existing application uses MySQL‑style SQL. However, PostgreSQL’s advanced features such as full SQL‑2011 support, sophisticated indexing options, and extensive extension ecosystem (e.g., PostGIS, hstore) are not available in MariaDB. Users who rely on those features or on PostgreSQL’s proven performance with very large, complex schemas should stay with PostgreSQL.

Couverture fonctionnelle60%
Licence
GPL-2.0
Prix
Gratuit
Dernière version
13.0.2
Note
—

Ce qui fonctionne pareil

  • Full ACID compliance
  • Built‑in replication and clustering
  • Extensible via plugins/extensions
  • Cross‑platform support (Linux, Windows, macOS)
  • Active community and regular releases

Ce qui change

  • MariaDB uses MySQL‑style SQL syntax, not full SQL‑2011; PostgreSQL offers richer data types (JSONB, arrays, hstore) and more advanced indexing (GIN, GiST)
  • PostgreSQL has superior support for complex queries, window functions, and common table expressions
  • MariaDB lacks PostgreSQL’s native logical replication and streaming WAL features
  • PostgreSQL provides built‑in full‑text search with more powerful analyzers
  • MariaDB’s extension ecosystem is smaller; PostgreSQL’s contrib modules are extensive

Ouvrir vos fichiers PostgreSQL

Opening or importing PostgreSQL dump files (.sql) into MariaDB is possible but requires manual editing: remove PostgreSQL‑specific commands (e.g., set, d, CREATE EXTENSION), adjust data types (e.g., SERIAL to AUTO_INCREMENT), and replace PostgreSQL‑specific functions. Exporting from MariaDB to PostgreSQL also needs conversion of SQL syntax and data types. For large migrations, using a neutral format such as CSV or a database‑agnostic tool is recommended.

Passer de PostgreSQL à MariaDB, étape par étape

  1. Export PostgreSQL data to CSV using COPY or pg_dump -Fc and then convert to plain SQL if needed
  2. Install MariaDB and create a new database matching the target schema
  3. Use a migration tool (e.g., pgloader) or write scripts to map PostgreSQL types to MariaDB equivalents
  4. Adjust stored procedures, triggers, and functions to MySQL syntax
  5. Test application queries for compatibility and performance
  6. Update application configuration to point to the new MariaDB instance

Fonctionnalités clés de MariaDB

  • Moteurs de stockage haute performance (InnoDB, Aria, XtraDB)
  • Réplication et clustering intégrés (Galera)
  • Conformité ACID complète
  • Extensible via des plugins (par ex., JSON, GIS)
  • Support communautaire actif et publications régulières
  • Compatibilité multiplateforme (Linux, Windows, macOS)

Installer MariaDB sous Linux

Ubuntu / Mintsudo apt install mariadb
Debiansudo apt install mariadb
Fedorasudo dnf install mariadb10.11
Arch / Manjarosudo pacman -S mariadb-lts-pam
openSUSEsudo zypper install mariadb

Questions fréquentes

Does MariaDB support PostgreSQL extensions like PostGIS?

No, MariaDB does not support PostGIS. It has its own GIS extensions, but they are not drop‑in replacements for PostGIS.

Can I run PostgreSQL and MariaDB on the same server?

Yes, both can run side‑by‑side. They use different ports (default 5432 for PostgreSQL, 3306 for MariaDB) and have separate data directories.

What about backup and restore?

MariaDB offers mysqldump, mysqlpump, and Percona XtraBackup for hot backups. PostgreSQL uses pg_dump, pg_dumpall, and pg_basebackup. Both provide reliable backup solutions, but the tooling and options differ.

3 autres alternatives à PostgreSQL

Toutes les alternatives à PostgreSQL

Notez MariaDB

Soyez le premier à noter
Bon remplaçant de PostgreSQL ? 9