Skip to main content

High Availability and Disaster Recovery

Docs: Disaster recovery planning guide

Key Definitions​

TermDefinition
RTO (Recovery Time Objective)Maximum acceptable downtime β€” how long until the service must be restored
RPO (Recovery Point Objective)Maximum acceptable data loss β€” how far back in time can you afford to lose data
SLAContractual uptime commitment made to customers
AvailabilityExpressed as a percentage; each additional "9" is 10Γ— harder to achieve
AvailabilityMax downtime/year
99%~87 hours
99.9%~8.7 hours
99.99%~52 minutes
99.999%~5 minutes

HA: Zones vs Regions​

  • Multi-zone β€” deploy across 2–3 zones within the same region. Protects against single zone failure. Lower latency and cost.
  • Multi-region β€” deploy across 2+ regions. Protects against full regional outage. Higher cost and latency.

Most applications need multi-zone for HA. Multi-region is required only when a regional GCP outage would breach SLA or compliance requirements.

DR Standby Patterns​

PatternDescriptionRTORPOCost
Cold standbyBackup data exists; resources are not running. Restore from scratch on failure.HoursHoursLowest
Warm standbyScaled-down replica running in a secondary region; promoted on failure.MinutesMinutesMedium
Hot standbyFull-scale replica actively serving traffic; failover is instantaneous.SecondsNear-zeroHighest

Choose cold when budget is the priority and RTO hours are acceptable. Choose hot only when the business requires near-zero downtime and cost is secondary.

GCP HA Patterns by Service​

ServiceHA Mechanism
Compute EngineRegional MIG β€” spread instances across zones; autohealing replaces failed VMs
Cloud SQLHA configuration β€” standby instance in a second zone; automatic failover in ~60s
Cloud SpannerMulti-region config β€” synchronously replicated across regions; 99.999% SLA
Cloud StorageMulti-region or dual-region buckets β€” data replicated across geographic locations
GKERegional cluster β€” control plane and nodes span 3 zones; nodes replaced automatically
Cloud RunGlobal; automatically distributed across zones within a region
Pub/SubFully managed; globally replicated by default
BigQueryGeo-redundant by default within a multi-region location

Health Checks and Failover​

  • Load balancer health checks β€” LB removes unhealthy backends from the pool automatically
  • MIG autohealing health checks β€” recreates VMs that fail the health check
  • Cloud SQL failover β€” promoted automatically when primary fails; clients reconnect via the same connection string

Cloud DNS and Failover Routing​

Use routing policies on Cloud DNS to implement failover:

  • Failover policy β€” primary/secondary records; secondary only active when primary health check fails
  • Weighted round-robin β€” distribute traffic across multiple endpoints with configurable weights

Docs: Cloud DNS routing policies

Exam Tips​

  • RTO = time to recover; RPO = data loss tolerance. Low RTO β†’ warm/hot standby. Low RPO β†’ synchronous replication (Spanner) or frequent snapshots.
  • "99.99% SLA" across regions β†’ Cloud Spanner multi-region or Cloud Storage multi-region; not Cloud SQL single-region (only 99.95%)
  • Warm standby is the most common exam answer β€” balances cost with acceptable RTO/RPO
  • Never use cold standby when RPO = zero; it always involves data loss

Official Documentation​