ADR-0018 — Event Store DR: zone-redundant PITR today, single-writer multi-region with service-managed failover planned
Context
The Incident Event Store (Cosmos DB NoSQL, established in ADR-0007) is the platform’s source of truth. Under the event-sourcing model (ADR-0006, § 8):
- Every projection (SQL operational store, read models, reporting store) can be rebuilt from the event log.
- Every downstream system (Service Bus subscriptions, workflow state, notifications) reads its correctness from the event log.
- Losing events is catastrophic and unrecoverable. Losing projections is a rebuild task.
That asymmetry means the Event Store carries the strictest DR bar of any data store on the platform:
- RPO 0 — no acceptable event loss.
- RTO ≤ 30 minutes — tighter than the platform-wide RTO of 1 hour (ADR-0017), because the operational store, read models, and Service Bus recovery all chain on top of an intact event store.
- Event ordering per aggregate (partition key) must be preserved across replication and recovery.
- Immutability — recovered events must be bit-identical.
- Auditability — timestamps, metadata, and user info faithfully replicated.
The reference doc Event Sourcing- Event Store Disaster Recovery.md enumerates two postures — same-region (zone-redundant + PITR) and multi-region (single-writer + service-managed failover) — plus the Cosmos consistency-model trade-off table. This ADR converts that reference into a platform decision aligned with ADR-0007 (Cosmos in Switzerland North, zone-redundant, session consistency, per-tenant partitioning) and ADR-0017 (multi-AZ today, warm-spare planned).
Forces / Drivers
- principles/README.md § 8 Event Sourcing — event log is the source of truth; RPO 0 non-negotiable.
- principles/README.md § 18 Data residency & compliance — DR pair constrained to Swiss North ↔ Swiss West.
- principles/README.md § 21 Azure-native managed services first — replication and failover primitives must be Cosmos-native (Continuous Backup, service-managed failover), Service Bus geo-replication, and SQL auto-failover groups. No ION-owned replication.
- principles/README.md § 17 Failure containment — event replay + idempotent projections make read-model reconstruction survivable; that lever exists only because the event log is durable.
- principles/README.md § 23 Blast-radius containment — a regional outage of the primary write region must not destroy an event that a consumer already emitted.
- Consistency model constraint — the event store uses session consistency (ADR-0007); Cosmos multi-region failover semantics vary sharply by consistency level.
- Serverless-tier constraint — Cosmos serverless does not support geo-replication; multi-region DR forces provisioned/autoscale throughput on the event store.
- RTO 30 min — the event store’s own tighter target absorbs recovery time before the platform-wide 1h RTO clock expires; downstream projections and Service Bus recovery use the remaining budget.
- In-flight commands must survive DR. Commands issued during the recovery window must be queued and processed post-recovery — the reference doc’s Service Bus Command topic TTL extension pattern is load-bearing.
Decision
Adopt a staged Event Store DR posture that matches the platform DR staging in ADR-0017.
Current state — Zone-redundant + Continuous Backup + PITR in Swiss North (active)
The Incident Event Store runs today with the Cosmos DB posture locked in ADR-0007:
- Zone Redundancy across the three AZs of Swiss North.
- Continuous Backup with 7-day (default) or 30-day (extended) retention, enabling Point-in-Time Restore (PITR) to any second-level timestamp.
- Session consistency for reads.
What this covers.
- Individual node outages — RTO 0, RPO 0. Cosmos handles this transparently.
- Zone outage — RTO 0, RPO 0. Cosmos handles this transparently.
- Data corruption / bad deploy — recoverable via PITR to a pre-corruption timestamp.
What this does not cover.
- Full-region outage in Swiss North. No Cosmos replica exists in Swiss West today, so a regional event forces the same-region PITR path with an RPO ≈ backup lag (~100 seconds for continuous backup) plus a full replay from Service Bus + DLQ for events between the last backup and outage time. This does not meet RPO 0. It is the documented current gap.
Planned direction — Single-writer multi-region with service-managed failover (planned)
The target posture, aligned with the Cosmos reliability reference and the DR-doc multi-region section:
- Cosmos DB account configured as:
- Single write region in Swiss North (primary).
- At least one read region in Swiss West (secondary).
- Service-managed failover enabled — Azure detects the regional
failure and transparently promotes Swiss West to the writable region;
no ION runbook action needed for the store itself. Client SDK
(
DefaultAzureCredential+CosmosClientwith preferred-region list) automatically routes writes to the new primary.
- Consistency model: Session consistency retained (unchanged from
ADR-0007).
- Per Microsoft’s reliability guidance, session consistency gives RPO ≈ 15 minutes on regional outage.
- RPO 0 in the strict Cosmos-native sense is only achievable with Strong consistency, which requires synchronous cross-region commits and is incompatible with the incident-pipeline SLA (see Alternative A).
- The RPO-0 requirement is met at the platform layer via the Service Bus command-queue continuity pattern (see below), not at the store layer alone.
- Continuous Backup + PITR retained in both regions as a defense-in- depth mechanism against corruption events (which failover does not protect against).
- Provisioned/autoscale throughput required. Cosmos serverless does not support geo-replication; the event store tier must be provisioned or autoscale.
- Event ordering is preserved by Cosmos internal replication (sequence numbers per partition key). Same-partition ordering survives failover.
Command-queue continuity — closing the 15-minute gap
The 15-minute RPO gap between session consistency and RPO 0 is closed at the Service Bus boundary, not at Cosmos:
- Service Bus is configured with geo-replication (Premium tier) — per ADR-0008 namespace, primary in Swiss North with a secondary in Swiss West.
- Command topic TTL is increased to 14 days on disaster declaration (Phase 2 of the reference DR runbook), so any command whose corresponding event was on the “lost” side of the Cosmos 15-minute window is re-processed from the command queue on recovery.
- The projection layer is required to be idempotent (principles/README.md § 17; patterns/idempotent-write.md) so command replay produces the same events.
- Result: end-to-end platform RPO for the event stream is effectively 0 from the customer/upstream perspective, even though Cosmos alone under session consistency has RPO ≈ 15 minutes.
Operational store (SQL / read model)
Operational stores are rebuildable from the event log; DR posture is therefore looser than for the event store itself:
- Zone Redundancy in Swiss North today (matches current platform posture).
- Planned: Auto-Failover Groups to Swiss West with forced failover on regional outage. RTO ~60 seconds per Azure SQL failover-group guidance; RPO ≈ 0 for committed data before disruption.
- Reconstruction path always available — event replay from Cosmos Change Feed via idempotent projections (Phase 5–6 of the reference DR runbook) can rebuild the operational store from scratch if failover fails.
DR runbook shape
The reference doc’s 7-phase runbook is adopted verbatim as the SRE-owned runbook shape:
- Detection & Declaration — automated monitoring + DR-lead sign-off.
- Freeze incoming commands — scale down command handlers; extend Service Bus command topic TTL to 14 days; maintenance-mode UI + HTTP 202 API responses.
- Event Store recovery — service-managed failover to Swiss West (no manual restore in the multi-region posture); PITR is the fallback path if failover is unavailable.
- Operational store recovery — forced failover of SQL auto-failover group.
- Service Bus recovery — forced promotion of Swiss West namespace to primary.
- Consistency validation — verify no missing/duplicate events, last event per aggregate root, sequential timestamps per aggregate.
- Event replay + read-model reconstruction — dedicated replay workers from Cosmos Change Feed with idempotent projections.
- Resume command processing — flush the queued commands with rate control, revert Service Bus TTL, cutover Front Door priority routing.
- Post-recovery — heightened monitoring + post-mortem.
Automated DR drills against gma are required to validate the runbook and
the empirical RTO/RPO figures.
Alternatives Considered
Option A — Strong consistency + multi-region write
- Rejected. Grounds:
- (decisive) Cross-region write latency destroys the incident-pipeline SLA. Strong consistency requires synchronous commit in both Swiss North and Swiss West; the ~5 ms cross-region hop adds to every write on the ingestion + enrichment critical path, whose per-event latency budget is measured in tens of milliseconds. The capacity model’s 5-events-per-second average and 25-events-per-second peak throughputs assume in-region writes.
- Cosmos Strong-consistency multi-region write is limited to a subset of regions with specific tier requirements; not all Swiss-region combinations qualify.
- The RPO 0 objective is achievable at the platform layer via the Service Bus command-queue continuity pattern, without paying the cross-region write-latency tax.
Option B — Session consistency + single region + PITR only (current, retained for now)
- Rejected as long-term posture. Grounds:
- (decisive) A regional outage in Swiss North exceeds RPO — up to ~100 seconds of events lost between the last continuous-backup checkpoint and the disaster time, requiring Service Bus replay to recover.
- RTO exceeds 30 minutes — same-region recovery requires PITR restore + full replay + operational-store rebuild. Reference DR-doc Phase 3–6 runbook estimates hours, not minutes.
- Retained as current posture until Swiss West replica is delivered; Option C (multi-region service-managed failover) is the target.
Option C — Single-writer + secondary read region + service-managed failover (selected — see Decision)
- Selected. See Decision → Planned direction. Best fit for RTO ≤ 30 min and RPO 0 (via command-queue continuity), residency- constrained to Swiss geography, and Cosmos-native.
Option D — Cosmos serverless tier
- Rejected. Grounds:
- (decisive) Cosmos serverless does not support geo-replication. Explicit product limitation per Microsoft documentation. Adopting serverless would forfeit the entire multi-region posture selected above.
- Serverless RU/s ceilings (5 000 RU/s per collection) do not match the event store’s write-throughput target at the 500 / 1000-cust capacity envelope.
Option E — Application-level cross-region event replication (ION-owned)
- Rejected. Grounds:
- (decisive) Violates § 21 Azure-native managed services first. Cosmos-native multi-region replication + service-managed failover exists as a first-class product feature; ION replicating events itself would take on replication correctness, ordering, monitoring, back-pressure, retry, and reconciliation — permanently.
- Ordering-per-partition guarantees are trivially wrong to reproduce outside the platform’s own replication engine.
- No feature advantage justifies that operational burden.
Option F — Bounded staleness consistency + multi-region write
- Rejected. Grounds:
- (decisive) K & T tuning is a per-workload science project. RPO depends on the (K, T) parameters and the observed lag; making that stable enough to meet an audit requirement is far more fragile than using session + command-queue continuity.
- Bounded-staleness restricts consistency guarantees for consumers in ways that projections and replay logic would need to be redesigned to tolerate.
- Adds complexity without a corresponding availability or throughput win over the selected option.
Option G — Same-region-only DR (no Swiss West replica ever)
- Rejected as long-term. Same reasoning as Option B; retained as transitional current state.
Rationale
The Event Store is the only place on the platform where losing data is platform-terminal. Everything downstream — SQL projections, read models, Service Bus subscriptions, workflow state, notifications, reporting — can be rebuilt from the event log via idempotent replay.
That asymmetry forces two things:
- The event store gets the strictest DR posture on the platform (tighter RTO than ADR-0017’s 1 hour, RPO 0). All operational cost of multi-region provisioned Cosmos is justified by this.
- Everything else can be rebuilt. Operational stores, read models, and reporting need only be recoverable — DR posture is looser and the replay path is the fallback.
The session-consistency choice inherited from ADR-0007 is retained because Strong consistency’s cross-region write latency is incompatible with the incident-pipeline SLA. The “15-minute Cosmos RPO” gap that session consistency creates on regional failover is closed at the Service Bus command-queue layer — commands issued during the outage window are queued (with extended TTL) and re-processed after failover, producing the same events via idempotent projections. This is a platform- level RPO 0, achieved by combining Cosmos service-managed failover + Service Bus geo-replication + idempotent projection design.
Service-managed failover (rather than customer-managed) is deliberate — one less runbook step for SRE to execute correctly under pressure, and Cosmos handles the sequence-number continuity Azure-natively.
Consequences
Positive
- Event store carries RPO 0 + RTO ≤ 30 min end-to-end (via command-queue continuity) — the strictest DR posture on the platform, matching the strictness of the “source of truth” role.
- Cosmos service-managed failover removes an entire class of runbook risk — no manual promotion under pressure.
- Session consistency is retained; incident-pipeline write latency stays in-region.
- Replay-from-Cosmos-Change-Feed is the fallback for any operational-store divergence; the read model is never a single point of failure.
- Continuous Backup + PITR protects against corruption events that failover cannot.
- Runbook shape locks in a well-understood 7-phase sequence with clear ownership and drill-ability.
Negative / Trade-offs
- Regional outage today exceeds RPO — the current same-region posture is a documented gap until Swiss West replica is delivered.
- Multi-region Cosmos cost. Provisioned/autoscale throughput (serverless not eligible) + secondary region + write RU for replication ≈ 2× event-store spend. Precise figures depend on the pending capacity- model open item C-8 (event-store per-region cost).
- Idempotency is mandatory, not aspirational. Every projection handler must be idempotent; a non-idempotent projection is a data-corruption bug waiting for a DR drill to expose it.
- Service Bus geo-replication tier upgrade required (Premium) — locked in ADR-0008; this ADR depends on that.
- DR drills are mandatory. Cosmos service-managed failover, SQL auto-
failover-group forced failover, Service Bus forced promotion, and the
command-queue flush pattern must be exercised in
gmaon a schedule. RTO and RPO figures are aspirational until measured empirically. - Session-consistency reads during failover may briefly see stale data
from the pre-failover session token; consumers must handle
session-not-availablegracefully (transient retry). - Continuous Backup retention (7 or 30 days) sets an upper bound on PITR reach; corruption events discovered after retention expiry are not recoverable via PITR (event replay remains available).
WAF Pillar Impact
- Reliability (primary) — closes the region-outage gap for the source- of-truth event log at RTO 30 min / RPO 0 (platform-level), using Azure- native failover primitives.
- Security — no change; multi-region replication stays within Swiss geography (Swiss North ↔ Swiss West); encryption + Managed Identity unchanged.
- Performance Efficiency — session consistency retained; in-region writes; incident-pipeline SLA preserved. Failover moves the write region cleanly.
- Cost Optimization — multi-region provisioned Cosmos adds cost; serverless option forfeited by DR posture. Warm-spare posture for the event store aligns with ADR-0017’s platform choice.
- Operational Excellence — service-managed failover reduces runbook
risk; 7-phase reference runbook + drill cadence in
gmabind the DR posture to executable practice.
Previous approach (V2)
V2 did not employ event sourcing as the primary persistence model (ADR-0006), so the concept of an “Event Store DR” did not exist. V2 depended on operational databases (Storage Tables + logic-app-managed state) whose DR was per-store, coarse, and not driven by a single source-of-truth guarantee. V3’s event-sourcing architecture creates both the strictness and the recoverability that this ADR encodes.
Amendments
-
2026-10-15 — Implementation gaps against the current state. The same-region DR inventory (reliability/dr) found that not every event store matches the decision:
- The investigations event store (
cosno-bcinv-prd-chn-01) uses Periodic backup (240-minute interval, 8-hour retention). Continuous backup is not on. Its corruption RPO is up to 4 hours, and a Periodic restore needs a Microsoft support request. This is an implementation gap, not a change to the decision. It is tracked as DR-01 (HIGH), and the target isContinuous30Days. - The tickets event store referenced in code was not found in the inventory. Tracked as DR-02 (HIGH) until its backup mode and zone redundancy are confirmed.
- Three event stores are on the T0 path: incidents, tickets, and investigations. The current-state posture in this ADR applies to all of them, not only to the Incident Event Store.
- The backup mode MUST be set explicitly in Terraform. The Periodic accounts were hidden because Terraform left the backup policy unset.
- The investigations event store (
-
2026-10-15 — Event-store targets apply to the planned posture. The RTO ≤ 30 minutes and RPO 0 in this ADR are targets for the planned single-writer multi-region posture. In the current same-region posture the event stores follow the per-scenario objectives in the ADR-0017 amendment “Reliability objectives clarified”: RPO 0 for node and zone failures, which Cosmos DB handles transparently within the platform’s zone-loss objective of minutes, and RTO ≤ 4 hours at PITR granularity for logical corruption on a T0 store.
-
2026-10-15 — Regional outage in the current posture. The “What this does not cover” section described a same-region PITR path with an RPO of about the backup lag during a full Swiss North outage. That is not a planned procedure: PITR restores into a region where the account exists, and Swiss North is the only one. In line with the ADR-0017 accepted risk, the event stores wait for the region to return. No event-store recovery target applies to a regional outage until the multi-region posture is delivered. The event-store recovery procedures now live in DR implementation: Cosmos DB, which replaces the former event-store DR pages.
The decision is unchanged.
References
- references/Event Sourcing- Event Store Disaster Recovery.md — primary source; same-region and multi-region requirements, 7-phase DR runbook, consistency-model RPO trade-off table.
- references/Event Sourcing- Event Store.md.
- references/Event Sourcing- Event Model.md.
- references/ION v3- Incidents Event Store.md.
- Azure Cosmos DB reliability — consistency-model RPO on regional outage table.
- Cosmos DB service-managed failover.
- Service Bus geo-replication.
- Azure SQL DB auto-failover groups.
- ADR-0006, ADR-0007, ADR-0008, ADR-0017.
- principles/README.md §§ 8, 17, 18, 21, 23.
- patterns/idempotent-write.md.
Related ADRs
- ADR-0006 — event sourcing is the reason the event store’s DR bar is this strict.
- ADR-0007 — locks Cosmos NoSQL
- Swiss North + zone-redundant + session consistency + per-tenant partitioning; this ADR builds the multi-region posture on top.
- ADR-0008 — Service Bus geo- replication is the mechanism that closes the 15-minute Cosmos RPO gap under session consistency.
- ADR-0017 — platform DR posture; the event store is the strictest specialization.