pg_hardstorage uses PostgreSQL's native streaming replication protocol (libpq with replication=true) as its sole data plane, enabling it to work against managed PostgreSQL services like RDS, Aurora, Cloud SQL, and Supabase where archive_command and filesystem access are unavailable. The agent connects via a minimal role with REPLICATION and pg_read_all_data privileges, streams WAL via a persistent physical slot, and uses BASE_BACKUP for initial data. This approach provides in-band flow control through slot lag, native Prometheus-compatible observability, dual-stream redundancy with CAS deduplication, and automatic Patroni failover handling. Trade-offs include consuming a replication slot and requiring max_slot_wal_keep_size monitoring for extended outages.

5m read timeFrom cybertec-postgresql.com
Post cover image
Table of contents
The choice: data plane = libpq + replication protocolConsequence 1: managed PostgreSQL works automaticallyConsequence 2: privilege model is dead simpleConsequence 3: backpressure is the slotConsequence 4: dual-stream WAL is essentially freeConsequence 5: failover is a reconnectWhat it costs
20.9K Impressions