Topic

PostgreSQL

Replication, point-in-time recovery, promotion, connection limits, and the version-upgrade surprises that only ever show up under production traffic.

PostgreSQL is the database I have used longest — since 2017 — and still my default for transactional systems. Most of what I know about it comes from the operational side rather than the query side: how far behind a standby actually falls under write pressure, point-in-time recovery you have rehearsed instead of documented, promotion while traffic is still arriving, connection limits meeting an application that opens a pool per worker, and major-version upgrades. On my failover rig, PostgreSQL 18 streaming replication held a replay lag of 383 µs — measured on the rig, not quoted from a release note.

All writing

Tutorial RHEL 8 Postgres lab on Apple Silicon Follow-along runbook

pgBackRest against a Patroni cluster: archive, rebuild, and restore

Wire pgBackRest into a running Patroni cluster over mutual TLS with Ansible, then prove it: full backup, replica rebuilt from the repo, and a point-in-time restore.

  • PostgreSQL
  • Distributed databases

~90 min on an existing cluster; the restore drill itself is ~15 min

Tutorial RHEL 8 Postgres lab on Apple Silicon Follow-along runbook

Patroni HA on PostgreSQL 18 with etcd, proven by killing the primary

Build a two-node Patroni cluster on Rocky 8 under QEMU, then SIGKILL the leader and measure the promotion, the timeline bump, and the pg_rewind rejoin.

  • PostgreSQL
  • Distributed databases

~2–3 h first bring-up (TCG is slow); ~5 min for the failover itself

Tutorial RHEL 8 Postgres lab on Apple Silicon Follow-along runbook

Dedicated pgBackRest TLS on RHEL 8 with Ansible—before Postgres

Stand up a dedicated pgBackRest TLS repo host on generic/rhel8 with Ansible-issued certs, then prove server-ping and mTLS from a client VM.

  • PostgreSQL
  • Self-hosted ops

~90 min first bring-up (TCG + dnf)

Tutorial The failover lab Measured on my own hardware

PostgreSQL 18 won't take a volume at /var/lib/postgresql/data

The mount point moved in the PG 18 image, so every compose file copied from a 12–17 guide breaks. The corrected file, then replication, promotion and PITR.

  • PostgreSQL

~35 min hands-on

Tutorial The failover lab Measured on my own hardware

A failover lab you can run on one laptop

Six database engines, eight failover scenarios, one 8-CPU Docker rig. The results matrix, the headline measurements, and how to run the first scenario.

  • Distributed databases
  • PostgreSQL

~45 min hands-on