HA/DR and cost optimization for the PCA exam: choose by RTO/RPO, multi-region and CUDs
The Professional Cloud Architect exam guide lists "high availability and fail-over design", "backup and recovery" and "cost optimization" in section 1 (~25%), and "disaster recovery" plus "cost optimization/resource optimization" in section 4 (~15%). On the exam they usually meet in one question: a downtime and data loss target, a budget, and you pick the cheapest design that still meets the target. This article goes deeper than the short HA/DR table in the case study post: what RTO and RPO really measure, Google's cold, warm and hot patterns, how each service behaves when a zone or a region fails, and which discounts fit which workload, with decision tables, short gcloud examples and example practice questions. For the exam format and scope, see the Professional Cloud Architect study guide.
Key takeaways
- RTO is how long you may be down, RPO is how much time of data you may lose; smaller values cost more.
- Zonal HA is not DR: Cloud SQL HA, regional MIGs and regional GKE survive a zone, not a region; BigQuery's US/EU multi-region doesn't replicate across regions.
- Region-level options: dual/multi-region Cloud Storage (turbo replication: 15-minute RPO), Spanner dual/multi-region (99.999%), Cloud SQL cross-region replica, BigQuery managed DR.
- SUDs are automatic (up to 30%), CUDs last 1 or 3 years and can't be cancelled, Spot VMs give up to 91% off but can be preempted; alerts-only budgets don't stop spending.
RTO and RPO: two numbers measured in time
Google's DR planning guide starts every plan with a business impact analysis that gives two numbers. RTO (recovery time objective) is the maximum time the application may be offline. RPO (recovery point objective) is the maximum length of time during which data may be lost. RPO is a length of time, not an amount of data: "we can lose at most 15 minutes of orders" is an RPO. The guide adds that smaller RTO and RPO mean higher cost and more complexity, and that both are measurable SLOs inside the SLA.
- RPO comes from how often data leaves the failing site. Snapshot every 4 hours and you can lose up to 4 hours of writes; the guide says your RPO is determined by the last snapshot taken. Synchronous replication brings RPO near zero; asynchronous replication leaves a gap equal to the replication lag.
- RTO is the whole chain. Someone must notice, decide to fail over, start resources, restore, test and switch DNS. Cloud SQL's DR page lists "the operations team recognizes and formally acknowledges the disaster" as a step, and that human step counts.
- One application can have several RTOs. In the guide's ecommerce example, checkout is hot while order emails can wait a few hours. Often only the critical part needs the expensive design.
Cold, warm and hot: Google's three DR patterns
The guide explains its three patterns with a flat tire: cold is no spare, so you wait for help; warm is a spare in the trunk, so you stop briefly; hot is run-flat tires, so you keep driving.
| Pattern | Running before the disaster | During failover | Typical fit |
|---|---|---|---|
| Cold | Backups in Cloud Storage, custom images, an IaC template | Create the environment, restore the latest backup, apply logs, test, switch DNS | Large RTO, low budget |
| Warm | A small database server that always receives replication; app servers kept as snapshots | Resize the database, create servers from snapshots, switch DNS | Minutes to hours; the guide calls it a good budget/availability trade-off |
| Hot | Full production in both places, serving traffic | Health checks and load balancing or DNS route around the failure | RTO/RPO near zero, highest cost |
Two details from the warm example make good answers: run the standby database on the smallest machine type that can accept replication (because it runs all month, sustained use discounts apply), and create reservations so capacity exists when you fail over. Inside Google Cloud, a cold pattern can be a MIG of size one plus scheduled snapshots: the MIG recreates a dead VM, but a zone failure needs manual action.
Naming: Google's DR guide doesn't use "pilot light". The closest match is its warm example, where only a small database replica runs ahead of time. "Backup and restore" maps to cold, "multi-site active-active" to hot.
Zone or region: HA is not DR
Ask what fails together: one VM, one zone or a whole region. HA features mostly cover a VM or a zone.
| Service and setting | Zone failure | Region failure |
|---|---|---|
| Regional MIG, regional GKE cluster | Survives | Needs a second region behind a global load balancer |
| Cloud SQL HA | Automatic failover | Needs a cross-region replica |
| Spanner regional (3 replicas, 3 zones) | Survives | Needs dual-region or multi-region |
| Cloud Storage regional bucket (2+ zones) | Survives | Needs a dual-region or multi-region bucket |
| BigQuery, including US/EU multi-region | Survives (2 zones) | Needs managed disaster recovery |
Replication doesn't fix mistakes. Cloud SQL HA writes each change to disks in both zones before commit, so a wrong DELETE reaches the standby instantly. Bad deploys, deletions and ransomware need backups, point-in-time recovery (PITR) or immutable backups.
Compute: regional MIGs, regional GKE and global load balancing
A regional MIG (managed instance group) spreads VMs across zones of one region, three by default or those you list with --zones; Google recommends it over zonal MIGs. When a zone fails, VMs in the other zones keep serving, but the group adds or redistributes nothing unless autoscaling is on, so docs strongly recommend overprovisioning. Autohealing recreates VMs whose application health check fails, and the health check probes must be allowed by a firewall rule.
gcloud compute instance-groups managed create web-mig \
--template=web-tpl --size=6 \
--region=us-central1 \
--health-check=web-hc --initial-delay=120
A regional GKE cluster replicates the control plane across zones and places nodes in three zones by default, so a zone outage doesn't touch the control plane. Autopilot clusters are always regional, and docs recommend regional clusters for production. Cost side: a regional Standard cluster's default node pool has nine nodes (three per zone), and cross-zone traffic is billed.
The global external Application Load Balancer (Premium Tier) gives one anycast IP and sends traffic to the closest healthy backend with capacity. With backends in two regions, a region outage becomes a routing change instead of a DNS change.
Disks are zonal. Snapshots restore in another region, regional persistent disks replicate across two zones, and Persistent Disk Asynchronous Replication covers cross-region active-passive DR.
Databases: Cloud SQL and Spanner
Cloud SQL HA and DR
- HA (one region): primary and standby in two zones; writes replicate synchronously to both zones' disks before commit. If heartbeats stop, the standby takes over the same IP; expect about 60 seconds of unavailability. The standby can't serve reads, HA costs twice a standalone instance, and backups plus PITR must be on.
- DR (another region): an HA instance fails with its region. Docs say the DR plan requires a cross-region read replica; replication is asynchronous, so RPO is likely non-zero. You promote the replica, repoint clients, prevent writes to the old primary (split-brain) and back up the new primary right away.
- Enterprise Plus advanced DR: designate a DR replica. Replica failover promotes it immediately and may lose data if it lags; switchover waits for zero lag, so it's lossless and used for drills and failback. A DNS write endpoint follows the primary.
gcloud sql instances patch orders-db \
--availability-type=REGIONAL
gcloud sql instances failover orders-db
gcloud sql instances create orders-dr \
--master-instance-name=orders-db \
--region=us-east1
gcloud sql instances promote-replica orders-dr
Naming: the legacy MySQL HA "failover replica" setup has been deprecated since 13 Jan 2025 and isn't covered by the SLA; old questions may still use the term.
Spanner configurations
- Regional: three read-write replicas in three zones, two of three form a write quorum; 99.99%.
- Dual-region (Enterprise Plus): six replicas in two regions of one country (Australia, Canada, Germany, India, Japan); 99.999% and zero RPO. Manual failover usually finishes within a minute; Google's automatic failover can take up to 45 minutes.
- Multi-region (Enterprise Plus), for example
nam3: usually two read-write regions plus a witness region; 99.999%, nearby reads, slightly higher write latency, automatic leader failover.
Read-only replicas don't work as a standalone DR solution, and an instance can move to another configuration without downtime.
Cloud Storage, BigQuery and Backup and DR
Cloud Storage: dual-region and multi-region buckets are active-active, with RTO zero and no path change. RPO is the catch: default replication targets 99.9% of new objects within one hour and 100% within 12 hours. Turbo replication, a premium option for dual-region buckets only, targets 100% within a 15-minute RPO. Cross-bucket replication has no RPO and doesn't replicate deletions.
gcloud storage buckets update gs://media-dr \
--rpo=ASYNC_TURBO
BigQuery: docs state that a multi-region location such as US or EU does not replicate across regions, and BigQuery doesn't provide durability or availability if a physical region is destroyed. Cross-region dataset replication (ALTER SCHEMA ... ADD REPLICA) keeps a read-only async copy but isn't intended as a DR plan: you can't promote it while the primary region is down. Managed disaster recovery (Enterprise Plus) uses a failover reservation with a secondary location. You trigger failover: hard proceeds even if the primary is offline and may lose data; soft waits for replication but needs both regions up. RTO is five minutes after you start, RPO aims for 15 minutes, and scheduled queries must be recreated.
Backup and DR centrally backs up workloads such as Compute Engine, disks, Cloud SQL and AlloyDB into a backup vault: Google-managed, immutable and indelible. With a minimum enforced retention (up to 99 years), nobody, Google included, can delete a backup early, and you pay storage for that whole period. This answers "ransomware" or "backups must not be deleted".
Naming: current docs say "Backup and DR"; older pages and the CUD list still say "Backup and DR Service".
Decision table: from RTO/RPO to architecture
| Requirement | Good choice | Clue in the question |
|---|---|---|
| Survive a zone, VMs | Regional MIG, autohealing, load balancer, overprovisioned | "zonal outage" |
| Survive a zone, MySQL/PostgreSQL | Cloud SQL HA (REGIONAL) | "automatic failover" |
| Region outage, minutes, small data loss OK | Cloud SQL cross-region replica or advanced DR | "another region", "RPO in minutes" |
| Global writes, RPO zero | Spanner dual-region or multi-region | "99.999%", "no data loss" |
| Files survive a region, same path | Dual/multi-region bucket, turbo replication | "15 minutes" |
| Warehouse survives its region | BigQuery managed DR | "regional outage", "analytics" |
| Hours of downtime OK, tight budget | Cold: backups in another region + Terraform | "cost-effective" |
| Deletion or ransomware | Backup vault with enforced retention | "immutable" |
Paying less for compute: SUDs, CUDs and Spot VMs
| Option | How it works | Watch out |
|---|---|---|
| Sustained use discounts (SUDs) | Automatic once a resource runs more than 25% of a month; up to 30% net for a full month | Only some series (N1, N2, N2D, C2, M1, M2, sole-tenant); not on usage covered by CUDs |
| Resource-based CUDs | Commit to vCPUs, memory, GPUs, Local SSD in one region for 1 or 3 years | Billed monthly whether used or not; can't be cancelled |
| Compute flexible CUDs (spend-based) | Commit to hourly spend across Compute Engine, GKE and Cloud Run, any project or region | Not for Spot or preemptible VMs |
| Spot VMs | Spare capacity, up to 91% off; can be preempted any time | Best-effort shutdown up to 30 seconds; batch and stateless only |
A practical order: resource-based CUDs for the stable baseline, flexible CUDs for spend that moves between machine types or services, on demand for the rest (where SUDs may apply). Spot VMs are the newer version of preemptible VMs: no maximum runtime unless you set one, default termination action STOP, an optional 120-second preemption notice, and a MIG recreates them when capacity returns. Databases and analytics also have spend-based CUDs, for example Cloud SQL, Spanner and BigQuery.
gcloud compute instances create batch-1 \
--zone=us-central1-a \
--machine-type=n2-standard-4 \
--provisioning-model=SPOT \
--instance-termination-action=DELETE
Naming: docs now also list Flexible Savings Plans (cross-product spend-based discounts measured monthly), and some spend-based CUDs are moving to a model using discounts instead of credits.
Rightsizing, storage classes and budgets
Rightsizing: Compute Engine machine type recommendations come from Cloud Monitoring metrics over the previous 8 days, are free, and get more precise with the Ops Agent. They aren't offered for VMs created by GKE, Dataflow or Managed Service for Apache Spark (formerly Dataproc), and 8 days can't capture monthly spikes. Rightsizing fixes the size of each VM; autoscaling fixes the number of VMs.
| Class | Minimum storage duration | Retrieval fee |
|---|---|---|
| Standard | None | None |
| Nearline | 30 days | Yes |
| Coldline | 90 days | Yes |
| Archive | 365 days | Yes |
Lifecycle rules change class or delete by age with no scripts. Docs use gcloud storage buckets update --lifecycle-file with JSON like this:
{"lifecycle": {"rule": [
{"action": {"type": "SetStorageClass",
"storageClass": "COLDLINE"},
"condition": {"age": 30}},
{"action": {"type": "Delete"},
"condition": {"age": 365}}
]}}
If access is unpredictable, Autoclass moves objects to colder classes when unused and back to Standard when read, for a management fee instead of retrieval and early deletion fees.
Budgets: an alerts-only budget emails when actual or forecasted cost crosses a threshold and can publish to Pub/Sub for automation, but it doesn't cap spending. Spend cap budgets exist only for a few services (Gemini API, Gemini Enterprise Agent Platform, Cloud Run, Cloud Run functions), one project and one service each.
gcloud billing budgets create \
--billing-account=BILLING_ID \
--display-name="prod-monthly" \
--budget-amount=5000USD \
--threshold-rule=percent=0.9
Trading cost against availability
Docs state the price of each step up: Cloud SQL HA costs twice a standalone instance; regional persistent disks use twice the storage; Spanner dual/multi-region costs more and needs Enterprise Plus; turbo replication is premium; regional GKE bills cross-zone traffic; enforced backup retention bills the whole period. The architect picks the cheapest design that meets the stated target, not the most available one. Split by RTO (hot checkout, cold reports), keep warm standbys small and resize at failover, and stay regional when a zone failure is the only stated risk.
Common traps
- MIG behind a load balancer keeps recreating VMs, yet
curlworks on each VM: allow the health check probes with a firewall rule. See practice question #9. - MIG VMs restart every few seconds and a colleague must debug: temporarily remove the health check so autohealing stops, then give SSH access. See question #46.
- Startup trial, unknown demand, minimize cost: free tier and SUDs, not a commitment you can't cancel. See question #44.
- Delete backups older than 90 days cheaply: a JSON lifecycle rule, not a cron script; the question uses
gsutil, docs now usegcloud storage. See question #17. - Keep one year at minimum cost: Standard to Coldline at 30 days, delete at 365. See TerramEarth question #2.
- Archive logs as long-term DR backup and try analytics: Cloud Storage plus BigQuery. See question #35.
- "Cloud SQL HA covers a region outage", "the US multi-region dataset is DR-ready", "Spanner read-only replicas are DR", "the budget will stop spending": all wrong, for the reasons above.
Reading the question
- Find the failure domain: zonal outage means regional services; regional outage means cross-region replication or multi-region.
- Translate to RPO: no data loss is synchronous or Spanner; 15 minutes fits turbo replication or BigQuery managed DR; a few hours allows cold.
- Predictable for 1 or 3 years means CUDs; unknown demand means SUDs; can be interrupted means Spot VMs; most cost-effective means the cheapest option that still meets the target.
Start practicing
Try the 60 free Professional Cloud Architect questions and watch for HA, DR and cost questions; when ready, try a timed exam (Pro). For the exam overview, see the Professional Cloud Architect study guide, and for case study technique, the PCA case study decision tables.