An Azure managed PostgreSQL database service for app development and deployment.
Based on our discussion, the proposed approach can be summarized as follows:
Zone-level failure
Configure Zone-Redundant High Availability (HA) on the primary PostgreSQL Flexible Server. Azure maintains a standby replica in another availability zone in the same region and can automatically fail over in the event of a zone-level failure.
Regional failure
Enable Geo-Redundant Backup on the primary server. Azure asynchronously copies the backup data and transaction logs to the paired region. If the primary region becomes unavailable, you can perform a geo-restore, which creates a new PostgreSQL Flexible Server in the paired region using the latest backup data available there. This is not an automatic failover to a running secondary server.
Therefore, the expected flow would be:
Primary PostgreSQL Server
→ Geo-redundant backup enabled
→ Backup replicated to paired region
→ Regional outage
→ Execute DR/Terraform recovery workflow
→ Geo-restore creates a new PostgreSQL server in the secondary region
→ Configure/validate networking and connectivity
→ Redirect the application to the recovered server.
The backup location itself does not need to be manually managed as a backup file. Azure handles the replication of the geo-redundant backup to the paired region.
Terraform implementation
You can maintain the normal deployment and DR recovery as separate Terraform workflows:
- Primary deployment: Create the PostgreSQL Flexible Server with the required HA and geo-redundant backup configuration.
- DR pipeline: Execute the geo-restore when a regional recovery is required and provide the required configuration for the restored server.
Geo-redundant backup needs to be enabled when the primary server is created; it cannot be enabled later by changing the backup redundancy setting on an already provisioned server.
Private networking
Since your current server uses private networking, the secondary region needs its own regional VNet/networking configuration. A VNet from Switzerland North cannot be reused in Switzerland West because VNets are regional. For geo-restore from a private-access server, the restored server must use a different VNet in the secondary region.
Recovery and RPO
Geo-backup replication is asynchronous. Microsoft documentation indicates that there can be up to approximately one hour of delay in the data available in the paired region, so the DR design should account for up to approximately one hour of RPO. Geo-restore recovers to the latest backup data available in the paired region; point-in-time recovery isn't currently available against the remote geo-redundant backup.
The actual recovery time depends on factors such as database size, the latest available backup, and transaction logs that need to be processed. Therefore, we recommend validating the complete recovery workflow in pre-production before relying on it for production.
Geo-restore vs. Read Replica
As discussed, these are different approaches:
- Geo-redundant backup + geo-restore: Lower infrastructure cost, but recovery requires creating a new server from the backup.
- Cross-region read replica: Maintains a secondary server and can be promoted during a regional failure, providing a different RPO/RTO profile but with additional infrastructure and cost.
Based on the stated 72-hour recovery requirement and cost considerations, the geo-redundant backup + geo-restore approach appears aligned with the requirement.
Recommended next step: We recommend implementing and testing the complete geo-restore workflow in the pre-production environment first, including the secondary-region networking and application connectivity, and then using the validated Terraform workflow for production DR.
References:
- Backup and restore in Azure Database for PostgreSQL Flexible Server
- Geo-disaster recovery in Azure Database for PostgreSQL Flexible Server
- Private access (VNet integration) for PostgreSQL Flexible Server
I hope this clarifies the expected architecture and recovery approach.
If this answers your question, please accept this answer. It may also help other customers looking for similar.