Install & design
Version choice (support lifecycle), package/source installs, directory/tablespace/parameter standards, extension policy.
PostgreSQL
Extensible and standards-compliant, PostgreSQL has become the go-to alternative to commercial databases. We deliver HA clusters with automatic failover, backups you can restore to a point in time, evidence-based tuning and migrations from Oracle and Tibero.
Architecture
The most widely used open-source combination: Patroni + a distributed configuration store (DCS) + PgBouncer/HAProxy + pgBackRest.
Patroni uses a DCS such as etcd, Consul or ZooKeeper to elect a leader and automatically promotes the most suitable replica when the primary fails. Applications always reach the current primary through HAProxy (or a VIP), while PgBouncer keeps connection counts under control.
WAL is archived continuously with pgBackRest, so a full backup plus WAL replay can restore the database to any chosen moment.
Scope
Version choice (support lifecycle), package/source installs, directory/tablespace/parameter standards, extension policy.
Streaming (physical) replication, logical replication (publication/subscription), Patroni failover, replication-slot management.
pgBackRest, Barman, pg_basebackup, WAL archiving, target-time recovery and regular verification.
shared_buffers, work_mem, WAL and checkpoints, autovacuum, plans, indexes and partitioning.
pg_stat_statements, pg_stat_activity, wait events, replication lag, bloat, Grafana/PMM dashboards.
pg_upgrade (e.g. --link) or low-downtime major upgrades via logical replication.
SCRAM-SHA-256, minimal pg_hba.conf, role design, TLS, row-level security, pgaudit.
ora2pg assessment and conversion, PL/SQL → PL/pgSQL, data validation, re-tuning.
Replication
| Option | What it is | Good for | Watch out for |
|---|---|---|---|
| Streaming replication | Physical replication shipping WAL byte-for-byte; sync or async | HA, read replicas, DR | Same major version and platform required |
| Logical replication | Table-level changes via publication/subscription | Partial replication, major upgrades, consolidation | DDL and sequences need separate handling |
| Patroni | DCS-based leader election, automatic failover, config management | Production HA standard | DCS availability and fencing design are key |
| PgBouncer | Lightweight pooler (session/transaction/statement modes) | Taming connection storms | Check session-state limits in transaction mode |
Backup & PITR
With a full backup and a WAL archive you can rewind to just before a failure or a mistaken change. A backup only counts once you have restored it.
# 1) Stop the service and restore to the target time
sudo systemctl stop postgresql
sudo -u postgres pgbackrest --stanza=main --delta \
--type=time "--target=2026-10-20 13:55:00+09" \
--target-action=promote restore
# 2) Start and confirm recovery has finished
sudo systemctl start postgresql
psql -c "select pg_is_in_recovery();" -- f = promoted-- postgresql.conf: shared_preload_libraries = 'pg_stat_statements'
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
SELECT queryid, calls,
round(total_exec_time::numeric, 1) AS total_ms,
round(mean_exec_time::numeric, 2) AS mean_ms,
rows, left(query, 80) AS query
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;Tuning
Migration
DBAs with commercial-database experience flag compatibility gaps up front.
Size objects and PL/SQL and estimate effort with an ora2pg report
Map types (NUMBER, DATE …), sequences, partitions and constraints
Packages, procedures and triggers to PL/pgSQL; adjust application SQL
Full load then a change-sync approach; verify counts and checksums
Compare and tune plans for representative business queries
Rehearse → cut over → monitor stabilisation
Lifecycle
FAQ
Replication itself is built in, but detecting failure, promoting, fencing the old primary and redirecting connections need extra tooling. Patroni is the leading open-source tool that automates this.
It pays off with many connections or frequent short-lived connections. In transaction pooling mode, check session-level features (some prepared-statement usage, session variables, etc.).
The usual approach is to sync a new-version cluster with logical replication and switch over in a short window. If you can accept downtime, pg_upgrade is simpler.
Optimiser, locking and transaction behaviour differ, so some queries need rewriting or index changes. We compare representative queries before and after and include tuning in the migration.
Tell us your clouds, database versions, topology and concerns, and we will propose an assessment scope and approach.