The design brief#
“A digital bank’s customer-facing services (login, accounts, payments) must stay available 24x7 even if an entire cloud region fails. Design the Kubernetes platform and the failover approach.”
1. Requirements and SLOs#
| Service tier | SLO (availability) | RTO | RPO |
|---|---|---|---|
| Tier 0: login, balances, payments initiation | 99.95% monthly | ≤ 15 min regional failover | ≤ 1 min (payments ledger: 0 for committed transactions) |
| Tier 1: statements, notifications | 99.9% | ≤ 1 h | ≤ 15 min |
| Tier 2: analytics, back-office | 99.5% | ≤ 24 h | ≤ 24 h |
Other requirements: EU data residency (two EU regions), PCI DSS scope isolation, peak 3,000 requests/s, deployments several times a day without downtime.
2. Topology#
- Two regions, each with production clusters spread across three availability zones.
- Tier 0 runs active-active for stateless services with a single-writer ledger (see data below); Tier 1 warm standby; Tier 2 backup and restore.
- Separate PCI cluster per region for card-processing workloads.
- A GitOps hub (Argo CD with ApplicationSets, itself deployed in both regions) keeps both regions on the same reviewed configuration.
3. Traffic management and failover#
sequenceDiagram
participant U as Users
participant G as Global DNS / GSLB
participant A as Region A gateway
participant B as Region B gateway
participant O as On-call + runbook
U->>G: resolve api.bank.example
G->>A: health checks OK → route 50/50 (Tier 0)
G->>B: health checks OK
Note over A: Region A degraded: SLO burn, health checks failing
G->>G: mark A unhealthy (automatic)
G-->>U: answers point to region B only
O->>B: scale up (pre-approved), promote replicas for Tier 1
O->>O: comms, status page, incident command
- Global DNS / anycast load balancing with health checks on synthetic transactions, not just TCP.
- Low DNS TTLs (30–60 s) and clients that honour them.
- Capacity: each region can carry 100% of Tier 0 peak (N+1 at region level) — the single most important cost decision.
- Automatic traffic failover for stateless tiers; human-approved promotion for data stores where split-brain risk exists.
4. Data#
| Data | Approach | Trade-off |
|---|---|---|
| Payments ledger | Single-writer primary in region A with synchronous replica in another zone and semi-sync/async cross-region replica; or a globally consistent database (for example Spanner-class or CockroachDB/YugabyteDB) | Synchronous cross-region adds latency; async risks small data loss → business decides |
| Customer profile | Multi-region database with async replication; conflict-free updates via ownership by region | Eventual consistency for reads |
| Sessions / cache | Regional Redis; sessions in signed tokens to survive failover | Cache warm-up after failover |
| Events | Kafka per region with MirrorMaker 2 / cluster linking | Duplicate handling via idempotent consumers |
| Object storage | Cross-region replication | Replication lag |
5. Delivery across regions#
- Same artifacts (by digest) and same Git state in both regions; ApplicationSets with region labels.
- Progressive rollout across regions: canary in region A → full region A → region B, with automated analysis (Argo Rollouts) and an error-budget gate.
- Infrastructure (clusters, networks, databases) as code (Terraform/OpenTofu or Crossplane), reproducible in a new region.
6. Observability#
- OpenTelemetry in all services; per-region Collector gateways; global query layer (Thanos/Mimir) so dashboards see both regions.
- SLOs per tier and region with multi-window burn-rate alerts.
- Synthetic probes from several external locations per critical journey.
7. Security#
- Separate cloud accounts/subscriptions per environment and PCI scope; private clusters; WAF and DDoS protection at the edge.
- mTLS (service mesh ambient mode) for Tier 0 services; default-deny NetworkPolicies.
- Signed images only; secrets in a replicated Vault/KMS per region; break-glass access audited.
8. DR runbooks and drills#
| Drill | Frequency | Success criterion |
|---|---|---|
| Zone failure (drain all nodes in a zone) | Monthly in staging, quarterly in prod | SLO maintained |
| Regional failover of Tier 0 | Quarterly | RTO ≤ 15 min, no data loss beyond RPO |
| Restore Tier 2 from backup into a new cluster | Twice a year | Within RTO |
| Dependency failure (IdP, DNS, payment network latency) | Game days | Graceful degradation works |
Automate failover steps in runbooks-as-code; record timings; feed gaps into the backlog.
9. Cost#
- Region-level N+1 roughly doubles Tier 0 compute — offset by spot for stateless non-critical services, rightsizing, Karpenter consolidation and commitments for the baseline.
- Warm standby for Tier 1 runs at ~25–30% capacity, scaling on failover.
- Cross-region data transfer is a material line item; design replication volume consciously.
10. Trade-offs#
| Decision | Chosen | Alternative |
|---|---|---|
| Tier 0 compute | Active-active | Warm standby: cheaper, longer RTO |
| Ledger | Single writer + replicas | Globally consistent DB: simpler failover, higher latency and cost |
| Failover trigger | Automatic for traffic, human for data promotion | Fully automatic: faster, split-brain risk |
| Cluster model | Per region × tier, PCI separate | Single large cluster per region: cheaper, larger blast radius |
Quick check#
Why must each region be able to carry 100% of Tier 0 load? Because after a regional failure the surviving region receives all traffic; without that headroom, failover becomes an outage.
Why is data promotion often human-approved while traffic failover is automatic? Promoting a database replica during a partial failure risks split-brain and data loss; a brief human decision is safer, while stateless traffic can shift automatically.
How do GitOps and IaC help DR? Regions and clusters are reproducible from code, so standby regions stay identical and new environments can be built quickly.
What should DR drills prove? That actual RTO and RPO meet objectives, runbooks work and dependencies are understood.
Summary#
- Tier services by RTO/RPO and choose active-active, warm standby or backup-restore accordingly.
- Multi-AZ clusters in two regions; health-based global traffic management; region-level capacity headroom.
- Treat data consistency explicitly; GitOps keeps regions identical.
- Prove it with regular drills and SLO monitoring.