Skip to content
RED SAGSkills
hardDatabase Administrator interview question

Design a high-availability setup for a critical PostgreSQL database with RPO near zero and RTO under one minute.

What the interviewer wants to hear

  • Primary with replicas in different availability zones
  • Synchronous replication to at least one standby for near-zero RPO
  • Automatic failover with a consensus store, e.g. Patroni with etcd
  • Fencing to avoid split-brain
  • Stable endpoint for apps, e.g. virtual IP, proxy or DNS
  • Backups and PITR still required; test failovers

Model answer

I would run three nodes across three availability zones: one primary and two standbys. For near-zero RPO I use synchronous replication with synchronous_standby_names set to ANY 1 of the two standbys, so a commit waits for one copy, but losing one standby does not stop writes. Patroni manages failover, using etcd or another consensus store with three members, so only the node holding the leader key can be primary. That quorum plus fencing, where the old primary demotes itself if it loses the lock, prevents split-brain. Applications connect through HAProxy or PgBouncer that follows the leader, so failover takes seconds. Sync replication adds latency to every commit, which we accept. HA does not protect against a bad DELETE, so pgBackRest backups with WAL archiving and PITR remain essential, and we test failover regularly.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Database Administrator questions