
Choosing a Linux Database: PostgreSQL and Other Picks
Start with PostgreSQL. For most database decisions on Linux, that one call is right unless something specific points elsewhere. Linux itself is an operating system, not a database, so the real choice is which engine you put on top of it. Pick MariaDB or MySQL when an existing app or toolchain already speaks their dialect, and SQLite when the data lives inside one program. Reach for distributed SQL like CockroachDB or TiDB only when your system has to survive losing a whole data center.
Last updated: 2026-10-19
Is Linux a database?
No. Linux is a kernel plus the tools a distribution wraps around it, and the kernel ships under the GNU General Public License version 2 only. Its job is scheduling, memory, devices, and filesystems. It stores files, but it has no query language, no schema, and no transactions that span records.
What Linux does give a database is everything underneath it. The page cache, fsync, the I/O scheduler, cgroups, and the out-of-memory killer all decide how your engine behaves under load. That's why so many "database bugs" turn out to be operating system behavior once you read the logs.
Linux is also the default home for these engines. It holds about 63.1% of the global server operating system market. So whatever database you pick will most likely run on a Linux box.
What people mean by a Linux database
When someone asks for a Linux DB or a database on Linux, they mean a database engine that runs on Linux. That engine comes in three shapes, and the shape decides where you look when it breaks.
- Server daemon. PostgreSQL, MariaDB, and MySQL run as their own process under a systemd unit. They listen on a TCP port or a Unix socket and serve many clients at once.
- Embedded library. SQLite and DuckDB link straight into your program. There's no daemon and no port, because the database is a file your process opens.
- Managed service. A cloud provider runs the daemon on Linux for you. You keep its failure modes and lose the shell you'd use to read them.
A Linux database application is any program that keeps its state in one of these. The split matters on a bad night. A daemon fails on connections, memory, and disk I/O, so you start with journalctl and ss.
An embedded engine fails differently. It fails on file locks and permissions inside your own process. So you start with strace and the mode on the database file.
Relational fundamentals that decide the ranking
Rank engines on how they keep data correct under concurrent writes. Popularity charts measure install counts, and install counts say nothing about what happens when two clients update the same row. These are the parts that separate the engines:
- Tables and schemas. Typed columns grouped into tables, and tables grouped into schemas. A strict engine rejects bad data at the door.
- Keys and constraints. Primary keys, foreign keys,
UNIQUE, andCHECK. Every constraint the engine enforces is a bug your application code never has to catch. - Transactions. The ACID guarantees: atomic, consistent, isolated, durable. Durability is where Linux enters, because it depends on
fsyncreaching the disk. - Isolation levels. PostgreSQL defaults to read committed, while MySQL's InnoDB engine defaults to repeatable read. As a result, the same SQL can return different answers under concurrency.
- Indexes. B-tree indexes make lookups cheap and every write a little dearer. The wrong index costs you on every insert.
- Query planning. The planner decides how to run your query.
EXPLAINshows that plan before you trust it.
Two details catch people. First, PostgreSQL's EXPLAIN with the ANALYZE option actually executes the statement as well as planning it. So wrap any DELETE or UPDATE in BEGIN and ROLLBACK before you analyze it.
Second, MySQL's innodb_flush_log_at_trx_commit defaults to 1. That setting writes the log buffer to the OS file and fsyncs it to disk on every commit. Lowering it is the classic "make MySQL faster" tip, and the speed comes straight out of your crash safety.
Filters that cut the list down
Every directory of Linux database software lists dozens of engines. I cut that to three or four with these filters, applied in this order:
- Workload. Transactional (OLTP, many small reads and writes) or analytical (OLAP, big scans over many rows). Most apps are transactional.
- Data model. Relational, document, or key-value. MongoDB Community Edition is free and source-available, and it suits documents, but most business data turns relational the moment you join two things.
- Deployment mode. Server, embedded, or managed. This decides who owns the pager.
- Compatibility. Your ORM, drivers, backup tools, and existing queries already speak a dialect. Changing it costs more than any benchmark gain.
- Licensing. Permissive, GPL, or source-available. It matters most if you ship the database inside a product or sell it as a service.
- Scale. One primary with replicas carries far more load than most teams expect.
- Operational burden. Apache Cassandra's own guidance says a minimal production server needs at least 2 cores and at least 8GB of RAM, and you run several. Count the machines and the people before you count features.
Firebird survives these filters more often than its profile suggests. It's free for commercial use with no license fees, it runs on Linux among other platforms, and it scales from an embedded single-user model up to enterprise-wide deployments with hundreds of simultaneous clients. Its multi-generational architecture also supports hybrid OLTP and OLAP work.
Still, the project's own claims of "excellent concurrency" and "high performance" are marketing until you test your workload. Meanwhile, the hosting and hiring pool around it is small. Firebird is worth a look for an app that needs one engine from embedded to server, and I'd skip it as a default.
Which Linux databases should you actually run?
PostgreSQL is the best overall choice for new systems on Linux. SQLite is the best budget pick, because it needs no server, no daemon, and no admin hours. Everything else in this table earns a place only when a specific constraint points at it.
| Engine | Shape | License | Use it for | Verdict |
|---|---|---|---|---|
| PostgreSQL | Server, relational | PostgreSQL License (permissive) | New production systems | Best overall |
| MariaDB | Server, relational | GPLv2 | MySQL-compatible apps | Worth it for compatibility |
| MySQL | Server, relational | GPLv2 or commercial from Oracle | Existing MySQL stacks | Keep it if you have it |
| SQLite | Embedded, relational | Public domain | Data owned by one program | Best budget |
| DuckDB | Embedded, analytical | MIT | Local analytics over files | Worth it for analysis work |
| CockroachDB / TiDB | Distributed SQL | Varies by project, read it first | Surviving a lost region | Only when you truly need it |
| MongoDB Community | Server, document | Source-available | Data that really is documents | Skip as a default |
| Apache Cassandra | Distributed, wide-column | Apache 2.0 | Huge write volume across nodes | Skip without an ops team |
| Firebird | Embedded or server | Open source | One engine from embedded to server | Niche pick |
Where each engine falls short
Every engine on that list has a catch the feature page leaves out. Here is what actually bites in production.
PostgreSQL and the MySQL family
PostgreSQL forks a process per connection. A few hundred idle connections from a chatty app eat memory fast, so put a connection pooler like PgBouncer in front of it early. The other catch is vacuum. Updates and deletes leave dead rows behind, and if autovacuum falls behind, tables bloat and queries slow down for no obvious reason.
MySQL has been around since its first release on May 23, 1995, and Oracle now owns it. That history means every hosting panel and PHP app supports it. However, older installs and some hosting configs still run without strict SQL mode, so check sql_mode before you trust it to reject bad data.
MariaDB started as a fork of MySQL and still reads most MySQL queries. Its own tuning docs cover buffers and caches, indexing, the query optimizer, compression, and the system variables that control performance. Read those before you copy a my.cnf from a forum, because the two projects have drifted apart on plenty of variables.
SQLite and other embedded engines
SQLite is everywhere, with over one trillion databases in active use. Its limit is writes. Many processes can run a SELECT at once, but only one process can change the database at any moment.
The default journal mode is DELETE. Many people switch to WAL mode so readers stop waiting on the writer, and for a busy app that switch is usually the right move. Either way, SQLite writes journal files next to the database, so the process needs write permission on the directory as well as the file. When you get a confusing "unable to open database file", run strace -f -e trace=openat and check the output for the path that failed.
DuckDB is the same idea built for scans. It's excellent for crunching a pile of Parquet or CSV files on one machine. It's a poor fit as the backing store for a web app with many writers.
Distributed and document stores
CockroachDB and TiDB buy you survival when a whole zone goes dark. In return, you pay with network latency on every write and a cluster you have to understand. If one primary with a replica covers your load, you're paying for a problem you don't have.
Cassandra is built for massive write volume, and it asks for several real servers and people who know its repair cycle. MongoDB is fine for data that truly is documents. Most teams end up rebuilding joins in application code, which is a relational database done badly.
Check the daemon before you blame the database

When an app reports "database down", the server is usually up and something between them is wrong. For PostgreSQL, run this first:
pg_isready -h localhost; echo $?
The exit code tells you which layer to chase:
- 0 means the server is accepting connections normally. Look at credentials,
pg_hba.conf, or the app's connection string. - 1 means the server is rejecting connections, for example during startup. Wait, then check whether it's stuck in recovery.
- 2 means there was no response at all. The daemon is dead, or you're hitting the wrong host, port, or socket.
- 3 means no attempt was made, usually because of bad parameters on your own command line.
On a 2, go to systemd. The unit name varies by distribution, so systemctl list-units | grep -i postgres finds it. Then journalctl -u <unit> -b shows why it stopped. For a broader routine, I follow the same steps as in this Linux log-checking workflow.
If the log shows nothing, check the kernel ring buffer with dmesg -T | grep -i -E "oom|killed". The OOM killer picks the biggest process on the box, and a database with a large cache is usually it.
FAQ
Should I run a PostgreSQL beta in production?
No. PostgreSQL 19 Beta 2 came out on July 16, 2026, and betas exist so people can find bugs before release. Test your app against one in staging, then move production after the final release ships. Check postgresql.org for whichever version is current when you read this.
Is MariaDB a drop-in replacement for MySQL?
For older apps and plain SQL, mostly yes. Newer features differ, including JSON handling, replication details, and some system variables. Restore a real dump into MariaDB and run your test suite before you switch.
Which filesystem should the database live on?
Ext4 and XFS are both safe local choices for PostgreSQL, MySQL, and MariaDB. Avoid putting SQLite on NFS or other network shares. File locking there is unreliable, and the result is corruption you'll find much later.
Can I run several engines on one Linux server?
You can, and small setups do it all the time. Give each engine its own memory limit, through its config file or a cgroup in its systemd unit. Otherwise two caches fight over the same RAM, and the OOM killer settles the argument for you.
