DR implementation: PostgreSQL Flexible Server
Tier: T1 to T2. PostgreSQL holds investigation service data and the ziege vector store for AI features. It is not an event store.
Current configuration (prd)
| Server | Use | HA | Backup retention | Geo-backup | Notes |
|---|---|---|---|---|---|
psql-bcinv-prd | Investigations service store | Zone-redundant | 7 days | Disabled | |
psql-zge-prd | Ziege vector store, pg_cron | Disabled | 7 days | Disabled | GP_D2ds_v5. DR-08 |
psql-hrald-prd | Herald vector store | Zone-redundant | 7 days | Disabled | Herald is legacy and at end of life. No DR investment |
With zone-redundant HA, a standby runs in another zone with synchronous replication. If the primary zone fails, the service fails over to the standby automatically, usually within a few minutes.
Failure scenarios
| Scenario | Behaviour | Recovery | RTO and RPO |
|---|---|---|---|
| Zone loss, HA server | Automatic failover to the standby | Automatic. Clients reconnect | Minutes. RPO 0 |
Zone loss, psql-zge | The server is unavailable until Microsoft recovers the zone | Microsoft-managed, or a PITR to a new server in a healthy zone | Until recovery. RPO 0 if the server waits, or the PITR point |
| Logical corruption | Wrong data | PITR to a new server | T2 target not set. RPO is the PITR point |
| Database dropped | Missing data | PITR to a new server, to just before the drop | Hours |
| Server deleted | The store is gone | Restore the deleted server within Microsoft’s recovery window for dropped servers | Hours |
| Vector index lost | AI features degrade | Re-embed from the source data | Depends on the volume |
Recovery procedures
PITR to a new server
Owner: Owning service team
Run az postgres flexible-server restore with --name <server>-rst-<yyyymmdd>,
--source-server, and --restore-time. Then:
- apply the network configuration, Entra admin, and parameters from Terraform;
- check that extensions such as
pg_cronandvectorare enabled; - re-create any
pg_cronjobs that do not travel with the database.
Cut over
Owner: Owning service team, approved by the destructive restore approver
Update the connection string in Key Vault or App Configuration. Restart the consumers. Keep the damaged server until the review closes.
Rules
- Zone-redundant HA MUST be on in
gmaandprd, as data protection requires. - Backup retention and geo-backup are set by data protection. Geo-backup is a backup copy, not a same-region DR capability.
- Servers MUST have
prevent_destroyand aCanNotDeletelock. - Scheduled jobs (
pg_cron) SHOULD be defined in migrations, so that a restored server gets them back.
Gaps
| ID | Severity | Gap | Owner |
|---|---|---|---|
| DR-08 | MEDIUM | psql-zge-prd has HA disabled | Ziege team |
| DR-22 | LOW | Geo-backup disabled on psql-bcinv-prd and psql-zge-prd | Owning service teams |
Validation and drills
- Twice a year in
gma: run a PITR of one server and time it, including the extension and job checks. - Zone-down test: confirm the HA failover time.