How to set PostgreSQL RPO and RTO before you design recovery
Teams often arrive with business recovery targets but no database design to match them. Recovery point objective (RPO) is the maximum amount of data, measured in time, that the business can afford to lose. Recovery time objective (RTO) is the maximum time a service can be unavailable before the impact is unacceptable. For PostgreSQL, these numbers are set per system by the owner of the data and the service, not by the database team alone. A reporting replica and a payment ledger can carry very different values, and each database needs its own pair written down before any tool is chosen. Ask the business owner to state both values for each outage scenario, including a single server failure, data corruption caused by an operator or application, and loss of the whole site.
Once the targets exist, the disaster recovery plan maps each one to a PostgreSQL mechanism. Continuous archiving of WAL files combined with a base backup supports point-in-time recovery, and the archiving interval bounds how much committed data can be lost in a restore. Hot standbys and synchronous replication address RTO for server failures and can reduce RPO toward zero, but they do not protect against a bad DELETE that replicates to every copy. PostgreSQL does not detect a failed primary or promote a standby on its own, so the plan must name the external failover tool, its detection timeout and who approves a switch. The plan should record, for each target, the component that meets it, the settings that enforce it (such as archive_timeout and synchronous_standby_names), and the evidence that proves it. Confirm the exact behavior of each setting against the PostgreSQL continuous archiving documentation and your PostgreSQL version before committing to numbers.
Which recovery design fits which RPO and RTO
This table compares five PostgreSQL recovery designs by the recovery point they can reach, the recovery time they imply, what they cost to run and their main risk. Read each row against your own RPO and RTO targets, then confirm restore times by measuring them in your environment rather than relying on any general estimate.
| Design | Recovery point and time | Operational cost and main risk | When it fits |
|---|---|---|---|
| Local standby with asynchronous replication | Recovery point is usually close to the primary, but unreplicated commits can be lost on failover. Promotion is fast once failover is automated. | Moderate. Needs external failover tooling because PostgreSQL does not detect failure itself. Main risk is silent loss of recent commits. | Systems that accept a small loss window and need quick service restoration within one site. |
| Synchronous standby | Recovery point aims for zero committed-transaction loss when the standby confirms commits. Promotion time is similar to asynchronous. | Higher. Commit latency rises with network distance, and a lagging or unavailable standby can stall writes. Main risk is availability impact, not data loss. | Workloads where any lost commit is unacceptable and the standby sits close enough to keep latency acceptable. |
| Archive-based point-in-time recovery from object storage | Recovery point depends on how often WAL is archived. Recovery time includes fetching a base backup and replaying WAL, so it is usually longer than promoting a standby. | Lower infrastructure but more restore work. Main risk is an untested restore or archive gap that only shows up during an incident. | Protection against logical errors, ransomware and site loss, where a longer restore is acceptable. |
| Delayed standby | Recovery point is intentionally behind the primary by the configured delay, so it protects against recent mistakes but not against the delay window itself. Recovery time is short if the delay point is still available. | Low to moderate. Costs a standby kept only for protection. Main risk is assuming it is a full replica, since it lags by design and may be stale when needed. | Rolling back accidental deletes or bad batch changes that are noticed within the delay window. |
| Incremental base backups with pg_combinebackup | Recovery point depends on backup and WAL archive frequency. Recovery time includes combining the backup chain before replay, which adds work compared with a full base backup. | Lower storage and backup time per run, with more chain management. Main risk is a broken or missing link in the chain, which must be caught by verification. | Large databases where full base backups are too slow or costly to run often, and where the team can verify chains routinely. |
Designing and testing a PostgreSQL DR plan step by step
This sequence turns recovery targets into a tested design, from classifying databases and agreeing RPO and RTO with their owners through to an annual timed restore that shows whether the plan works.
Classify each database by business impact
List every PostgreSQL cluster and database, then group them by what an outage or data loss would cost the business, including regulatory exposure and downstream systems that depend on them. Your team and the application owners do this together, because they know which data is transactional and which can be rebuilt. The step is done when each database has an impact tier and a named owner who will sign off on its targets.
Set RPO and RTO per system with owners
For each tier, agree a recovery point objective (how much committed data may be lost) and a recovery time objective (how long the service may be down). Record the numbers in writing with the business owner, and note which teams must be available to meet them. Ask any partner or internal team to show the figures they would commit to before work starts, because targets set without a tested design are only intentions. The step is done when every system has signed targets in the DR register.
Choose replication and WAL archive design
Map the RPO to the replication and archiving pattern. Asynchronous streaming replication plus continuous WAL archiving leaves a window of unarchived or unreplicated data, while synchronous replication lets a commit wait for a standby at the cost of write latency. Point-in-time recovery needs a base backup plus archived WAL, so decide the archive frequency and where archives land. The step is done when a written design states which mechanism covers which RPO and what it costs in latency and storage.
Place standbys in a separate failure domain
Put standbys on different hosts, racks, storage and power sources, and where your footprint allows, in a different site or availability zone from the primary. A standby in the same failure domain can fail with the primary, so placement matters as much as the replica count. Confirm the network path and latency between sites against the synchronous commit choice. The step is done when a documented failure-domain map shows that no single event takes out the primary and all its standbys.
Store backups off site with separate credentials
Keep at least one copy of base backups and WAL in a location that a compromise of the primary cannot reach, using repository credentials and administrative accounts that differ from the database's. Check retention and deletion protections so that an operator error or ransomware event cannot remove the only copies. The step is done when a test credential used by the database host cannot delete or overwrite backup objects, and that result is recorded.
Write failover and restore runbooks
Document the steps for promoting a standby, redirecting applications and restoring from backup to a chosen point in time. PostgreSQL does not detect a failed primary or promote a standby on its own, so name the external failover tool your design uses, its fencing behavior and who may trigger it. Include a decision point for choosing between failover and restore. The step is done when an engineer who did not write the runbook can follow it in a lab and reach a promoted or restored database.
Confirm alerts and restore to a chosen time
Test the monitoring before relying on it: break the archive path on purpose and confirm that archive lag or failed archive alerts fire and reach the on-call channel. Then restore a copy of the database to a chosen timestamp and check that the data matches the expected state and that the elapsed time is measured against the RTO. The step is done when alert delivery and a timed point-in-time restore are both recorded as evidence.
Schedule an annual DR test with timed restore
Set a recurring annual exercise that covers at least one failover and one full restore, run against current backups and current runbooks rather than a copy of last year's plan. Record the start and end times, the data checks performed, any runbook gaps and the owners of each fix. Repeat the exercise after major configuration changes or PostgreSQL upgrades. The step is done when the test report is filed, gaps have owners and dates, and the RPO and RTO figures are updated from measured results.
How primary, standbys, WAL archive and off-site copies fit together
The diagram starts at the primary server in the production trust boundary. It streams changes to a hot standby in a separate failure domain and ships archived WAL and base backups to a backup repository in another location. The restore path runs from that archive to a new server, using credentials kept apart from production. Check that the standby does not share the primary's failure domain, that the archive is reachable without production admin access, and that restores are tested on a schedule.
Primary, standby, archive and restore paths across trust boundaries.
Protecting backups and failover paths from ransomware and operator error
A recovery plan only meets its objectives if the backups and failover paths survive the same incident that caused the outage. The cards below cover the four failure modes that most often defeat PostgreSQL recovery: reachable backups, stale standbys, unprotected archives and undocumented procedures.
Keep backups out of production reach
Backups that share credentials with the production database can be deleted or overwritten by anyone who compromises it. Use a separate repository account and separate storage credentials, with write-only access for the backup job where the tool supports it. Confirm with your storage vendor whether object lock, versioning or soft delete can be enforced on the bucket so that deletions are retained for a set period. Ask who holds the keys to the backup account and whether that group overlaps with production administrators.
Stop failover from promoting stale data
A standby that lags behind the primary can be promoted during an incident, which silently discards committed transactions and widens the real recovery point beyond the stated RPO. Decide whether synchronous replication is required for the workloads that cannot lose data, and set a maximum replay lag that blocks automatic promotion. PostgreSQL does not detect a failed primary on its own, so the external failover tool must check lag and fence the old primary before it accepts writes. Test this path with a planned promotion before it is needed.
Failover docsEncrypt archives and manage their keys
Base backups, WAL archives and dumps contain every row in the database, so an unencrypted copy in object storage is a data exposure event on its own. Encrypt the repository with a key that is stored separately from the backup data, and decide who can read that key and how rotation is recorded. Confirm that the backup tool you choose encrypts both base backups and archived WAL segments, because a partial setup leaves some data readable. Keep a tested procedure for restoring when the key store itself is unavailable.
Log access to recovery systems
Ransomware and insider actions often show up first as unusual reads or deletes against the backup repository, not as a database fault. Enable access logging on the storage bucket and the backup host, and forward those logs to a system that operators outside the database team can review. Record who initiated each restore, promotion and retention change, with a timestamp and ticket reference. Alert on repository deletions and on backup jobs that stop running, since a silent gap in the archive weakens the RPO without any visible error.
Write runbooks that do not depend on one person
A failover or restore that only one engineer knows how to perform will fail when that engineer is unavailable during an incident. Write runbooks for promotion, point-in-time restore, repository recovery and access revocation, and keep them in a location that survives loss of the database servers. Each step should name the command, the expected output and the person who approves a destructive action. Review the runbooks after each annual DR test and after any change to the backup tool, the authentication setup or the storage account.
Questions buyers ask about PostgreSQL DR planning
What does a PostgreSQL disaster recovery engagement cost?
Cost depends on the scope written into the engagement, so there is no fixed figure for every environment. DeployOpen does not publish a price list. A quote follows from a written scope that names the databases, the recovery targets, the backup and standby design, and the tests to be run. The main cost drivers are the number of PostgreSQL clusters, total data volume, how many standbys and backup repositories are required, whether copies must sit in a separate site or account, and how often restores are tested. Ask for the quote to split one-time design and build work from any recurring testing or retainer support, so you can see which costs repeat each year.
How long does it take to set RPO and RTO targets and build the plan?
The duration depends on how many systems are in scope and how quickly business owners can agree on recovery targets. Most of the time usually goes to decisions, not configuration: confirming how much data loss each application can tolerate and how long it can stay down. Build time then depends on the backup tool chosen, the storage and network paths available, and whether standbys and off-site copies must be provisioned. Ask the provider to state the phases, the decisions needed from your side, and the point at which a restore test is run, all within the written scope and timeline.
What must our team provide during a PostgreSQL DR engagement?
The engagement needs decisions and access more than hands-on effort from your side. Expect to provide:
- A named owner for each system, who can accept the recovery point and recovery time targets for their data.
- Network and storage access to the database hosts, backup repositories and any off-site location, including credentials for a separate account if one is planned.
- Change windows for configuration changes, standby creation and planned restore tests that may briefly affect service.
- Access to the current backup jobs, retention rules and monitoring so the design starts from what already exists.
Agree these items in the written scope so delays from missing access or unavailable owners are visible early.
Can our own database team design and run PostgreSQL disaster recovery internally?
Yes, many teams can, provided they have someone who understands continuous archiving, base backups, standby promotion and restore testing. PostgreSQL provides point-in-time recovery from a base backup plus archived WAL files, and it documents hot standbys and both synchronous and asynchronous replication. What PostgreSQL does not provide is automatic failover detection, so that layer needs an external tool and its own testing. Internal teams usually struggle with keeping runbooks current, scheduling annual DR tests, and producing evidence for auditors. Compare your staff time against a scoped engagement and decide which parts you will own after handover.
Which factors make PostgreSQL disaster recovery more expensive to build and run?
Several factors raise both the build effort and the ongoing cost:
- Number of databases and clusters, since each needs its own backup chain, retention rules and restore procedure.
- Data volume, which affects base backup duration, storage capacity and how long a full restore takes.
- Standby count, because each standby adds compute, storage and replication monitoring.
- Geographic separation, since copies in another site or region add network capacity, encryption handling and access controls.
- Test frequency, because restore drills consume staff time and may need spare capacity to run without touching production.
Reducing any of these changes the recovery targets you can credibly commit to, so decide targets first.
How often should we run a PostgreSQL disaster recovery test?
Run a full restore test at least once a year, and run smaller restore checks more often, such as after backup tool changes or PostgreSQL minor updates. The annual test should follow the runbook from start to finish, restore into an isolated environment, and record the time taken against your recovery time objective. PostgreSQL releases minor versions at least once every three months, so keep a planned update cycle in the runbook. Write the test frequency into the scope so its cost and staff time are visible in the quote.
What happens to our PostgreSQL disaster recovery plan when we upgrade PostgreSQL?
A major upgrade changes the recovery procedure, so the plan and the restore test must be updated afterward. Minor releases keep the same storage format, so updating mainly means replacing executables and restarting. Major upgrades use pg_dumpall and restore, pg_upgrade, or logical replication, and each affects how backups and standbys are rebuilt. Confirm which PostgreSQL versions are still supported for your environment, since version 14 is supported until November 12, 2026 according to the versioning policy. Include an upgrade step in the runbook and repeat a restore check on the new version.
Does a PostgreSQL disaster recovery engagement include a guarantee that we will meet our RTO?
The engagement delivers a designed plan, the build work listed in the written scope, and tested evidence of what was restored and how long it took. Whether a recovery time objective is met in a real incident depends on factors outside any single design, including hardware failure, network conditions and staff availability during an outage. Use the restore test results to decide whether the target is realistic for each system, and adjust the target or design where the test falls short. Ask the provider to show exactly what the test covers and what it leaves to your team.
Why an annual DR test is the only proof the targets hold
A disaster recovery plan is unproven until someone restores the database, times the restore against the recovery time objective, and checks how much data came back against the recovery point objective. Until then, the RPO and RTO are estimates written in a document. An annual test is the point where those numbers become measurements. It should be run against the real backup repository, the real WAL archive and the real standby or failover path, not a copy someone built for the exercise, because the gaps usually sit in the parts that were not tested.
A useful annual test covers three exercises. First, a point-in-time restore to a chosen target time, with the team recording when the restore started, when the cluster accepted connections and which recovery target was used. Second, a failover drill that promotes a standby and confirms that applications reconnect, typically through the connection pooler and the failover tool named in the design. Third, a walkthrough of the runbook by the people who would actually execute it, including on-call staff who did not write it. Each step should record the elapsed time, the person who performed it and any deviation from the written procedure. Confirm with your failover tooling and backup software which recovery target types and verification commands they support in your versions before you write the test script.
Keep the results as dated records: the scope, the target times, measured recovery times, the data-loss check, defects found and the fix date for each. DeployOpen can prepare this evidence and the controls behind it for a compliance assessment, but it does not issue audit reports or attestations. Ask your assessor early which artifacts they expect, because a clear record of the test is what an assessor can review.
How DeployOpen scopes and delivers PostgreSQL recovery design
DeployOpen plans, implements, documents and supports self-hosted PostgreSQL recovery inside your own infrastructure, starting from the recovery point and recovery time objectives your business has agreed. The work covers WAL archiving, standby placement, backup location, runbooks and the annual restore tests that show whether the design holds.
How we scope
- We confirm which databases, clusters and data stores fall under the recovery design and who owns each one.
- We record agreed RPO and RTO values per system, and the failure scenarios they must cover, in the written scope.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- We identify which backup, standby and failover tools your environment already runs before choosing any new ones.
How we build
- We design WAL archiving frequency, base backup cadence and retention against the recovery point target you set.
- We place standbys and backup repositories so a single site or account failure does not remove every recovery copy.
- We write restore runbooks with named steps, owners and decision points, then time a restore against the recovery time target.
- We configure access controls and separate credentials for backup repositories so operators cannot silently alter recovery copies.
How we hand over
- You receive the recovery design, configuration records, runbooks and the measured restore timings from the test runs.
- We walk your operations and on-call staff through the restore procedure and the decisions that belong to them.
- We set out an annual disaster recovery test plan, including scenarios, evidence to keep and who signs off the results.
- We prepare recovery evidence for your compliance and audit teams, though independent auditors and certification bodies issue any assessment.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
- Retainers can cover scheduled restore drills, runbook updates after platform changes and review of new backup tooling versions.
- We re-test recovery when PostgreSQL major or minor versions change, when storage moves or when RPO and RTO targets change.
- Ask any provider to confirm in writing which restore tests, reports and response times are included before you sign.

