Prepare and test your skills
Prepare and test your skills
Disaster Recovery Architectural Patterns describe how much of a recovery environment is kept running before a disaster happens. In Google Cloud, the three patterns are cold standby, warm standby, and hot standby. Cold standby keeps only backups and templates, warm standby keeps a small live database, and hot standby keeps two live environments. The choice depends on recovery time objective (RTO), recovery point objective (RPO), and whether protection is needed against zonal or regional outages.
Recovery objectives and geographic scope define how fast recovery must be and what size of failure must be survived. RTO answers how long after a disaster before service runs again, while RPO answers how much data can be lost. Smaller RTO and RPO values mean higher cost and complexity because more infrastructure must stay running and more data must be continuously copied. In general, high availability covers one region with synchronous replication between zones, while disaster recovery covers multiple regions with usually asynchronous replication and manual or semi-automated failover.
Geography defines what fails together. Compute Engine (opens in a new tab) virtual machines and Persistent Disk are zonal resources hosted in a single zone, so a zone interruption can make them unavailable. Regional resources are deployed across multiple zones in a region and automatically serve from another zone if one zone fails. Multi-regional resources are distributed within and across regions to survive a regional outage, but they trade latency, consistency, and cost through synchronous versus asynchronous replication.
The cold standby pattern keeps no live application servers running and restores everything from backups only after a disaster. Data flows from the production environment to Cloud Storage (opens in a new tab) through scheduled backups, while application configuration is stored as custom Compute Engine images and a Deployment Manager template. Cloud DNS stays pointed at production until failover, then it is reconfigured to point at the recovery environment in Google Cloud.
Recovery follows an ordered sequence that first rebuilds compute, then restores data, then moves traffic:
Cold standby has the highest RTO and RPO because virtual machines must be created, backups restored, and DNS updated during the outage. It has the lowest running cost because stopped virtual machines do not incur compute charges, although attached disks and stored images still do. Choose cold standby when interruptions of hours are acceptable, such as for batch jobs with checkpoints or back-office applications.
The warm standby pattern keeps a minimal live recovery system running so failover is faster than cold but cheaper than hot. A small database instance in Google Cloud runs at all times and receives replicated transactions from production through asynchronous or semi-synchronous replication. Web and application tiers are not kept at full size; their updated pages and binaries are preserved through Compute Engine snapshots and custom images, then scaled out with Deployment Manager during failover.
Connectivity flows from the on-premises network to the Google Cloud virtual private cloud (VPC) network over Cloud Interconnect (opens in a new tab) with a self-managed virtual private network (VPN) solution. Data flows continuously from the primary database to the standby database replica, while Cloud DNS continues to direct users to production. On failure, traffic is rerouted to Google Cloud, additional application servers launch from images, and the already-running database is promoted to accept production writes.
This pattern uses the following building blocks:
Warm standby provides smaller RTO and RPO than cold because the database is already synchronized and only the front end must be scaled. Cost stays moderate by running the database on the smallest capable machine type, which can also earn sustained use discounts. Choose warm standby when moderate RTO and RPO are required without paying for two full production environments.
The hot standby pattern keeps two full environments active at the same time, with both capable of handling production traffic. User traffic flows from clients to Cloud Load Balancing (opens in a new tab), which distributes requests across zones or regions, and data flows between active databases through continuous replication. Managed multi-regional services such as Spanner (opens in a new tab) and Cloud Storage provide built-in redundancy and synchronization across regions without manual disk restores.
Because both sides are live, failover requires only DNS or load balancer adjustment and promotion of a replica if the database does not promote automatically. Architectures labeled RPO zero require data to be written in multiple locations before a transaction is committed, which reduces data loss but increases latency. Hot standby delivers the lowest RTO and RPO, often near zero, but carries the highest complexity and cost for compute, replication, networking, and synchronization. Choose hot standby for mission-critical workloads such as real-time payments and ecommerce purchase pipelines that cannot tolerate downtime.
Choosing a pattern by targets and distribution means matching application criticality to outage scope and replication behavior. Tier 1 customer-facing systems need multi-region protection with near-zero targets, Tier 2 regional systems tolerate minutes to an hour, and Tier 3 departmental systems tolerate hours. Zonal protection can rely on regional disks and managed instance groups across zones, while regional protection requires a second region, multi-regional storage, and regular failover testing.
| Pattern | Readiness before disaster | Choose when |
|---|---|---|
| Cold standby | Only backups in Cloud Storage, snapshots, images, and templates; no running app servers | Higher RTO and RPO are acceptable and minimizing running cost matters most |
| Warm standby | Small live database replica with continuous replication; app tier scaled down | Moderate RTO and RPO are needed without the expense of full duplication |
| Hot standby | Two live environments with load balancing and continuous replication | Minimal downtime and data loss are required for critical operations |
After a regional design is built, it must be tested regularly with isolated tests that avoid split-brain conflicts with production. Testing validates backup consistency, data transfer, restoration from stored backups, security controls, and network routing. Without testing, an architecture may appear multi-region resilient but fail to recover within its stated RTO and RPO.
Exam tip: Cold restores from backups after the disaster, warm keeps a live database replica while the app tier scales on failover, and hot keeps both environments live behind load balancing.
Data Persistence and Snapshot Management is the practice of protecting stateful data so it survives zonal outages, regional outages, and logical corruption. RTO answers how long after a disaster before the system is up and running, while RPO answers how much data can be lost. In Google Cloud, Compute Engine Persistent Disk snapshots provide point-in-time copies for recovery, and Cloud Storage lifecycle management moves backup copies to lower-cost tiers for long-term durability.
Persistent disks and snapshots provide durable block storage and point-in-time copies that remain independent of virtual machine (VM) instances. Persistent Disk (opens in a new tab) attaches to Compute Engine instances but can be detached and kept after an instance is deleted, and it includes built-in redundancy against equipment failure. Snapshots capture only changed blocks after the first complete snapshot, take only minutes even when disks are attached to running instances, and can be copied across regions to recreate disks after a disaster.
Snapshot copies flow from the source disk to snapshot storage and then to a new disk in the recovery zone or region. Standard persistent disks are zonal, so a zonal failure requires recreating the disk from a snapshot in another zone or region. Snapshots stored in a multi-region location remain available outside the failed region, which allows the same backup to support both zonal recovery and cross-region recovery.
Automated snapshot schedules and retention policies control how much data can be lost and how far back recovery can go. Backup frequency determines RPO because the time since the last backup is the maximum data at risk, while retention determines how far back the recovery point can move to avoid logical errors. Schedules can create snapshots on an hourly, daily, or weekly basis, and retention policies automatically delete snapshots after a specified time to control storage cost.
The snapshot lifecycle follows an ordered sequence:
Snapshot consistency is controlled only at the block level, so write activity on the file system should be suspended during snapshots to ensure file-level consistency. Because RPO is dictated by snapshot frequency, a 24-hour schedule can lose almost 24 hours of updates if failure occurs just before the next backup.
Cross-region replication and regional durability determine whether recovery needs a restore step or can fail over directly. Regional Persistent Disk (opens in a new tab) synchronously replicates writes across two zones in the same region, so a backup VM in the secondary zone can force-attach the disk after a zonal outage without restoring a snapshot. Persistent Disk Asynchronous Replication provides block-level replication for cross-region active-passive disaster recovery with low RPO and low RTO at the infrastructure level.
Durable designs combine synchronous protection inside a region with asynchronous copies outside it:
Regional disks remove the snapshot restore step for zonal outages, but zonal disks and regional outages still depend on snapshots or cross-region copies. The result is a layered design where fast zonal failover and slower regional rebuild use different mechanisms.
Cloud Storage (opens in a new tab) lifecycle management protects backup data by moving objects through progressively lower-cost storage tiers as access becomes less frequent. A common tiered pattern migrates data from persistent disks to backup buckets and then to infrequent-access classes, because retained backups are rarely read but must remain durable. Nearline is designed for backup scenarios with access at most about once a month, which supports regular recovery tests while keeping storage cost low.
The storage classes differ by access pattern and cost tradeoff:
| Storage class | Intended access pattern | Cost tradeoff |
|---|---|---|
| Standard | High-frequency access to active data | Higher storage cost, no minimum duration penalty |
| Nearline | Backup data accessed at most once a month | Lower storage cost with retrieval costs and minimum storage duration |
| Coldline | Infrequently accessed backup and archival data | Lower storage cost than Nearline with higher retrieval costs and longer minimum duration |
| Archive | Lowest-frequency long-term retention | Lowest storage cost with highest retrieval costs and longest minimum duration |
Protection against deletion and early overwrite comes from bucket-level controls that sit around the stored objects. Soft Delete preserves deleted and overwritten objects for a specified period, Object holds prevent deletion or updates, and Bucket Lock retention policies automatically enforce how long backup files are kept. Retrieval fees and minimum-duration charges apply to Nearline, Coldline, and Archive, so frequency of access and retention length must be balanced against durability needs.
Exam tip: Regional Persistent Disk avoids a snapshot restore for a zonal outage, but zonal disks and regional outages still require snapshots or cross-region replication for recovery.
Database Recovery and Point-in-Time Restoration is the ability to bring a relational or non-relational database back to a specific moment before a failure, error, or disaster. Recovery combines a full backup with transaction or archive logs that record every change after that backup. Together they let an architect meet an RTO for downtime and an RPO for acceptable data loss.
RTO and RPO for database recovery set the limits for downtime and data loss that the backup design must meet. RTO is the maximum acceptable time an application can be offline, or how long after a disaster before service resumes. RPO is the maximum acceptable time window of data that can be lost, or how much data can be lost in a disaster. Smaller RTO and RPO values cost more to run because they require more frequent backups, replication, and ready standby infrastructure. Backup frequency controls RPO, while the readiness of infrastructure, software, and data at the recovery site controls RTO.
Why database backups differ from data backups is that databases must recover to a point in time, not just copy files. A data backup copies a discrete amount of data to restore a known good state, with a small to medium RTO and small RPO. A database recovery must also ensure the recovery system mirrors production configuration with the same database version and disk layout, then apply the latest full backup followed by the transaction logs backed up after that backup. Because version mismatch and log replay add complexity, a high-availability-first design that keeps a replica or standby close to production achieves smaller RTO and RPO values.
Cloud SQL (opens in a new tab) automated backups provide scheduled, managed backups for relational workloads without managing the underlying infrastructure. Point-in-time recovery (PITR) for Cloud SQL extends those backups into a near-continuous protection model that can restore data to a specific temporal state between backups. The backup schedule must align with RPO, so if the RPO is 15 minutes, backups must run at least every 15 minutes to limit loss. After each backup, automated consistency checks verify the snapshot is usable, and restoration is tested in a non-production environment before it is needed in production.
Spanner (opens in a new tab) point-in-time recovery (PITR) lets an application recover data from a specific point in time in the past, up to a maximum of 7 days. Spanner PITR is designed for logical errors such as an operator writing the wrong data or an application rollout corrupting the database. The service retains the history needed to select a timestamp before the corruption and recover from that point. Spanner backups complement PITR for longer retention and for copying data to another project, dataset, or table on a schedule.
Bigtable (opens in a new tab) backups save a copy of a table's schema and data so the data can later be restored to a new table, including a table in a different instance. Backups are handled entirely by the Bigtable service with no import or export, share physical storage incrementally with the source table, and expire automatically after a user-defined retention period. Restoration always flows from the backup copy to a newly created table, and then requests are re-routed from the corrupted or unavailable table to the new table.
Backups can be created in three peer ways that cover different operational needs:
For zone unavailability, the strategy is to keep a backup copy on clusters in different zones and restore from the remote copy if the serving cluster becomes unavailable. The two Bigtable backup types trade long-term retention against restore performance:
| Backup type | Optimized for | Restore behavior |
|---|---|---|
| Standard backups | Long-term retention | Requires additional optimization by Bigtable to bring a table restored to an SSD cluster to production-level performance |
| Hot backups | Disaster recovery readiness | Provides the most efficient restoration to production-level performance and low-latency serving |
Self-managed database recovery to a point in time covers MySQL, PostgreSQL, or SQL Server running on Compute Engine (opens in a new tab) without managing physical infrastructure. Backup and DR Service is the centralized, cloud-native solution for backing up and recovering these cloud and hybrid workloads, with dedicated support for MySQL, PostgreSQL, and SQL Server. For point-in-time recovery, regular virtual machine (VM) backups are combined with frequent standalone Persistent Disk backups of a dedicated log disk that capture database archive logs. The log-disk schedule sets the recovery granularity, such as every 15 minutes or hourly, and retention is kept to the minimum period that still covers the required recovery window.
Recovery flows from the backup vault to the restored instance and then forward through logs in a fixed order:
Standard persistent disks are zonal, so snapshots are required to re-create disks in another zone or region, while regional persistent disks synchronously replicate data to another zone and can avoid the snapshot restore step. The choice between them is dictated by budget and by the required RTO and RPO values.
Exam tip: A Bigtable restore never overwrites the source table; it always creates a new table that you must point applications to.
Cold standby keeps no live application servers running and restores everything from backups in Cloud Storage after a disaster, warm standby keeps a small live database replica with continuous replication while the application tier is scaled out on failover, and hot standby keeps two full live environments with load balancing and continuous replication. Cold standby has the highest recovery time objective (RTO) and recovery point objective (RPO) with the lowest running cost, warm standby has smaller RTO and RPO with moderate cost, and hot standby has the lowest RTO and RPO with the highest cost and complexity.
Hot standby should be used for mission-critical workloads such as real-time payments and ecommerce purchase pipelines that cannot tolerate downtime because it delivers the lowest recovery time objective (RTO) and recovery point objective (RPO), often near zero. Cold standby should be used when interruptions of hours are acceptable such as for batch jobs with checkpoints or back-office applications, and warm standby should be used when moderate RTO and RPO are required without paying for two full production environments.
Regional Persistent Disk synchronously replicates writes across two zones in the same region, so a backup virtual machine in the secondary zone can force-attach the disk after a zonal outage without restoring a snapshot. Zonal disks require recreating the disk from a snapshot in another zone or region, and regional outages still depend on snapshots or cross-region copies.
Spanner point-in-time recovery (PITR) lets an application recover data from a specific timestamp in the past up to a maximum of 7 days and is designed for logical errors such as an operator writing the wrong data or an application rollout corrupting the database. Spanner backups complement point-in-time recovery (PITR) for longer retention and for copying data to another project, dataset, or table on a schedule.
An enterprise runs mission-critical stateful workloads on Compute Engine virtual machines in the us-central1 region using zonal Persistent Disks. The architecture team needs to establish a backup and disaster recovery strategy that satisfies several operational and compliance requirements:
us-east1 regionWhich solution should you recommend to meet these requirements?
Last updated