Replication copies change; high availability detects failure, promotes a suitable node, routes clients, and prevents two writable primaries. Physical streaming replicates WAL at cluster level; logical replication publishes selected table changes. Synchronous configuration can reduce acknowledged-data loss at latency/availability cost. Every failover design needs fencing, recovery objectives, and drills.
Replication is a data movement mechanism. HA is an orchestrated state machine:
Skipping fencing risks split brain.
Physical streaming creates a binary-compatible standby suitable for HA/read workloads. Logical replication uses publications/subscriptions for selected tables and supports other migration/integration patterns, but schema DDL, sequences, conflicts, replica identity, and feature coverage require explicit management.
Replication slots protect required WAL for consumers but can fill disk when a consumer stalls. Monitor retained bytes and set operational limits appropriate to version/provider.
Read replicas may serve stale access policies or knowledge versions. Do not route permission-sensitive or read-after-write retrieval blindly. Logical streams can feed analytics/search, but deletion and policy changes need low-lag guarantees and fail-closed behavior.
In a disposable or managed lab, document primary/standby roles, generate a marker transaction, measure send/write/flush/replay positions, promote according to the runbook, reconnect clients, and prove whether the marker survived. Validate RLS, extensions, jobs, sequences, and application writes after failover.
Write a failover game-day runbook for SignalDesk with one primary and two standbys across failure domains.
Acceptance criterion: it proves fencing before promotion, declares allowable data loss, tests client recovery, and preserves one job leader.