Recovery and disaster recovery
Recovery restores service after node, zone, corruption, consumer, or region failure. The event store is authoritative and must recover with no data loss; projections are rebuildable and recover on a looser path by replaying events.
Status: zone-redundant PITR is live in Swiss North. The multi-region topology below is the planned direction (ADR-0018, still proposed), not a deployed capability.
Objectives
| Objective | Target | Current posture |
|---|---|---|
| Event store RPO | 0 | 0 for node/zone; a region loss falls back to PITR + command replay (the documented gap). |
| Event store RTO | 30 minutes | Met for node/zone; not yet proven for a full-region loss. |
| Operational store (SQL) RPO | ≤ 24 hours, rebuildable to 0 from events | Zone-redundant; rebuildable by replay. |
| Service Bus RPO | < 5 minutes | Zone-redundant (RPO 0 for node/zone). |
| Order, immutability, auditability | Preserved across recovery | Enforced by sequence-per-stream and immutable events. |
Failure-to-mechanism matrix
| Failure | Mechanism | RTO / RPO | Status |
|---|---|---|---|
| Node outage | Cosmos / SQL / Service Bus zone redundancy, transparent | 0 / 0 | Live |
| Availability-zone outage | Zone redundancy across the three Swiss North AZs | 0 / 0 | Live |
| Data corruption / bad deploy | Cosmos Continuous Backup + Point-in-Time Restore | Restore time / backup lag (~100 s) | Live |
| Full-region outage | PITR + replay from Service Bus command queue (same region) | Within gap; not RPO 0 | Live gap |
| Full-region outage | Single-writer multi-region + service-managed failover + SB geo-replication | 30 min / platform-level 0 | Planned |
Recovery order
Recover authority first, then continuity, then derived data:
- Event store — the source of truth.
- Command continuity — the Service Bus command queue holding in-flight intent.
- Publisher and consumer checkpoints — Change Feed leases and projection cursors.
- Operational projections — rebuilt by replay.
- Customer analytics — rebuilt by replay, tenant-isolated.
- External reconciliation — Sentinel and ServiceNow, via authorized reprocessing, never bypass writes.
Current recovery boundary (Swiss North)
Cosmos event stores run with zone redundancy and Continuous Backup with Point-in-Time Restore in Swiss North. This gives RTO 0 / RPO 0 for node and zone failures and a PITR path for corruption. There is no deployed Swiss West event-store replica, so a full-region outage uses same-region PITR (RPO ≈ backup lag) plus a replay of commands queued in Service Bus — which does not meet strict RPO 0. This is the documented current gap.
Platform-level RPO 0: command-queue continuity
Under session consistency, Cosmos alone has an ≈15-minute regional RPO. ION closes that gap at the Service Bus boundary rather than by forcing Strong consistency (which the incident-pipeline SLA cannot absorb):
- Commands are durable in the Service Bus command queue before any event is written.
- On disaster declaration the command topic TTL is raised to 14 days, so any command whose event landed on the “lost” side of the window survives.
- Projections and command handlers are idempotent, so replaying those commands reproduces the same events without duplication.
The result is an effective end-to-end RPO of 0 from the upstream perspective, even when the store layer alone would lose a short window.
Disaster-recovery runbook
The SRE-owned runbook adopts the reference’s phased shape. The DR process diagram is the visual companion.
Phase 1 — Detection and declaration
Automated monitoring (health probes, Azure Service Health) flags the outage; the DR lead verifies scope and formally declares the disaster, triggering the runbook.
Phase 2 — Freeze incoming commands
Stop writing events into a recovering store. Scale down or stop the command-handling front ends; serve a maintenance page and return HTTP 202 for queued API commands; raise the command topic TTL to 14 days so in-flight commands survive until recovery completes.
Phase 3 — Recover the event store (Cosmos DB)
- Planned multi-region: service-managed failover promotes Swiss West to writable; the client SDK’s preferred-region list reroutes writes automatically. No manual data restore. Ordering is preserved by per-partition sequence.
- Current / fallback: initiate Point-in-Time Restore to the last good timestamp.
Identify the restored stream tip (
_ts/ last sequence per aggregate) — the recovery-point event. Everything after it is treated as missing and replayed.
Phase 4 — Recover the operational store (SQL)
Fail over the SQL auto-failover group (planned multi-region) or restore from PITR (current). Do not enable command processing yet — the read model is still out of sync with the recovered event store.
Phase 5 — Recover Service Bus
Promote the secondary namespace to primary (planned geo-replication) or confirm the zone-redundant namespace. Forced promotion places the namespace in read-only until promotion completes; planned promotion first drains replication lag. Reconcile topic and dead-letter messages into the correct order before replay.
Phase 6 — Validate consistency before opening
Verify the recovered event store before any traffic:
- no missing or duplicate events;
- last event per aggregate root is correct;
- sequences and timestamps are monotonic per aggregate.
Phase 7 — Replay to rebuild read models
Bring projections into line with the recovered event store:
- Pause normal projectors so they do not race the replay.
- Set the replay start to the recovery-point event (and cross-check the operational store’s last-updated aggregate timestamps, plus any DLQ ordering).
- Run dedicated, isolated, high-concurrency replay workers with idempotent handlers — see replay isolation.
- Reconcile aggregate versions and counts against the event stream.
- Open the operational store read-only once replay and reconciliation pass.
Phase 8 — Resume command processing and cut over
- Re-enable normal projectors for live events.
- Flush commands queued during the freeze through a rate-controlled processor, with aggregate-version checks to reject stale updates and dead-lettering for failures.
- Cut user traffic over via Front Door.
- Restore the command topic TTL to its normal value once the backlog drains.
- Communicate that service is restored.
Phase 9 — Post-recovery
Maintain heightened monitoring, tune the new primary, and run a post-mortem that records achieved RTO/RPO versus target and feeds runbook fixes.
Recovery-exercise validation
A DR drill (required against the gma environment) must confirm:
- latest event and sequence for sampled and high-value streams;
- no missing or duplicate committed events;
- schema-reader coverage for all retained history;
- command idempotency after queue resumption;
- projection rebuild correctness and catch-up time within RTO;
- Sentinel and ServiceNow reconciliation with no bypass writes;
- customer-analytics accuracy and tenant isolation.
Current vs planned
| Capability | Current (Swiss North) | Planned (ADR-0018) |
|---|---|---|
| Cosmos redundancy | Zone-redundant, single write region | Single write region + Swiss West read region |
| Regional failover | Manual PITR + command replay | Service-managed failover |
| Service Bus | Zone-redundant namespace | Premium geo-replication, customer-managed promotion |
| SQL read model | Zone-redundant + PITR | Auto-failover group to Swiss West |
| Region-loss RPO | Backup lag + replay (gap) | Platform-level 0 via command continuity |
The multi-region designs are intended behavior. Current capability is established by deployed infrastructure and exercised runbooks, not by the diagrams.