DR implementation: Azure SQL Database
Tier: T0 for the incidents operational store, T1 and T2 for the others. Azure SQL holds operational stores and reporting projections. Most of this data is derived from the event stores, so a recovery can choose between a PITR and a rebuild by replay (ADR-0022).
Current configuration (prd)
| Database (short name) | Tier | Zone-redundant | Backup storage |
|---|---|---|---|
sqldb-bcinc-prd | Premium P1 | No. Premium supports it | Geo |
bccfg | Standard S3 | No. Standard DTU does not support it | Geo |
bcast | Standard S3 | No | Geo |
gaia | Standard S3 | No | Geo |
plafr-ext | Standard S3 | No | Geo |
plafr-int | Standard S1 | No | Geo |
Failure scenarios
| Scenario | Behaviour | Recovery | RTO and RPO |
|---|---|---|---|
| Zone loss | Not zone-redundant, so the database can be unavailable until Microsoft recovers it. For bcinc, the T0 incidents flow is affected | Microsoft-managed | Until Microsoft recovers. RPO 0 for committed transactions in most cases |
| Logical corruption or a bad migration | Wrong rows or schema | PITR to a new database, or a rebuild by replay | T0 objective of 4 hours or less. RPO is the PITR point |
| Table or rows deleted | Missing data | PITR to a new database, then copy the rows back | Hours |
| Database deleted | The store is gone | Restore the deleted database, to its deletion time, within retention | Hours |
| Server deleted | Every database on it is gone | Recreate the server from Terraform, then open a Microsoft support request to restore the databases | Hours or more. Locks matter most here |
| DTU exhaustion | Timeouts | Scale the tier, or shed load | Minutes |
Recovery procedures
PITR to a new database
Owner: Owning service team
Run az sql db restore with --dest-name <db>-rst-<yyyymmdd> and the restore
time. The restored database keeps the source tier. Apply the Entra admin,
firewall, and auditing settings from Terraform if they differ.
Bring a projection up to date
Owner: Owning service team
After a PITR, the projection is behind the event store. Reset the projector’s checkpoint to the restore point and replay forward. Projectors are idempotent by event position (ADR-0022).
Cut over
Owner: Owning service team, approved by the destructive restore approver
Update the connection setting, or rename the databases, so that the app uses the restored database. Keep the damaged database until the review closes.
Rules
- PITR retention is set by data protection.
- T0 and T1 databases MUST be zone-redundant in
gmaandprd. Data protection sets the same requirement. - Logical servers MUST have a
CanNotDeletelock, because a deleted server is much harder to recover than a deleted database. - Every projection MUST document its rebuild-by-replay path and the time it takes.
Gaps
| ID | Severity | Gap | Owner |
|---|---|---|---|
| DR-04 | HIGH | sqldb-bcinc-prd is not zone-redundant, and Premium supports it | Incidents team |
| DR-05 | MEDIUM | The Standard DTU databases are not zone-redundant. Interim per ADR-0022 | Owning service teams |
Validation and drills
- Twice a year in
gma: run a PITR of one database, then replay its projection forward. Record both durations. - After DR-04 is closed: include
bcincin the Chaos Studio zone-down test.