Prepare and test your skills
Prepare and test your skills
Analyze deployment triggers and rollback criteria is the practice of deciding when a failed deployment must be reversed. The decision uses recovery time objective (RTO), which answers how long after a disaster before the system is up and running, and recovery point objective (RPO), which answers how much data can be lost. A rollback is necessary when monitoring shows the new version cannot meet those objectives without prolonged degradation or data loss.
Rollback triggers combine system health signals with business impact tolerance. System signals include automated consistency checks after each backup, backup health tracked by the Google Cloud Backup and DR service (opens in a new tab), adherence to backup intervals measured against RPO, and replication status between primary and secondary environments. User impact signals include application performance degradation, failed synthetic user scenarios in the recovered environment, and aggregate availability loss across tiers calculated as tier1_availability × tier2_availability × tierN_availability.
Cloud Monitoring (opens in a new tab) turns RPO and backup health into actionable thresholds by sending alerts when backup intervals exceed the defined RPO. For example, if RPO is 15 minutes, backups must run at least every 15 minutes, and any exceedance triggers an alert that feeds the rollback decision. Restoration testing must then validate the entire application stack with restored data, not only the database, to confirm that the deployed application works correctly before traffic is returned. Do not perform production cutover until test results are satisfactory, because both the forward migration and the fallback must be tested to avoid a severe outage.
Monitor the following signals in both primary and secondary environments to separate a transient fault from a rollback-worthy failure:
Automated thresholds initiate fast, repeatable recovery without waiting for human judgment, while manual intervention handles decisions that require business and risk assessment. Automated responses include Eventarc or Workflows triggering remedial actions from audit logs, autoscaling adding capacity during failover, Compute Engine managed instance groups (MIGs) (opens in a new tab) automatically recreating failed virtual machines (VMs), and regional load balancing shifting traffic across healthy resources. The high availability (HA) feature of Cloud SQL (opens in a new tab) provides a near active-active topology with read replicas across zones and a near-zero RPO between regions, which supports zero or near-zero RTO without manual steps.
Manual or semi-automated scenarios apply when replication is asynchronous across regions, when failover regions are constrained by data sovereignty and residency, or when the elapsed time of a migration task exceeds its planned window. Define success criteria and timebox all migration execution tasks, and collect expected durations from a dry run. If a one-time migration or backup restore does not finish in the expected time, the documented next action may be to postpone the migration rather than continue. Increasing availability from 99% to 99.9% reduces potential downtime from 864 seconds to 86 seconds per day but increases cost, complexity, and operational overhead, so the choice between automated failover and manual recovery reflects tradeoffs among availability, latency, cost, and regulatory requirements.
Exam tip: An alert that backup intervals exceeded RPO signals that a threshold was breached, but the rollback itself still requires a scoped recovery operation with a dry run, a mandatory recovery timestamp, and explicit execution — the alert does not perform the rollback.
A rollback scope defines exactly what returns to a prior state, and narrow scoping reduces user impact compared to a full environment reversal. The Cloud Healthcare API (opens in a new tab) method fhirStores.rollback illustrates scoped rollback: the point-in-time parameter is mandatory and must be a recovery point within the last 21 days in RFC 3339 format to the second with time zone, for example 2017-01-01T00:00:00Z. Broader scope can be limited by operation type, while resource scope can be limited to a resource type such as Patient, a list of resource identifiers such as Patient/123 stored in Cloud Storage, or filters on resource.meta field values.
Execution of the scoped rollback depends on permissions, output handling, and behavior flags. The caller needs the healthcare.fhirStores.rollback permission through Healthcare FHIR Store Administrator (roles/healthcare.fhirStoreAdmin), and the Cloud Healthcare Service Agent service account needs permission to write output files to the Cloud Storage destination. The output destination in Cloud Storage is required, the production call must set force to true, and two behavior options change the result: a dry run writes what would happen to Cloud Storage without affecting resources in the store, while Ignore previous rollbacks excludes the effects of prior rollback operations from the current calculation. Before recovering in production, run the dry run and inspect the dry run output files to ensure production recovery runs as expected.
Fallback is the return to the source system after cutover when the target shows issues, and fallback must be treated as a full database migration including planning and testing. Simple fallback switches applications back to the original source database instance, which is appropriate when downtime during fallback is acceptable or when transactions committed on the new target system are not needed. When transactions on the target must be preserved, implement a reverse replication mechanism that synchronizes changes back to the source database after switching to the target, because the initial load plus ongoing replication, monitoring, validation, and synchronization make the setup more intricate.
A typical ordered recovery and return sequence preserves data integrity across the switch:
The cost and speed of this operation depend on standby readiness. Hot, warm, and cold models trade continuous cost for RTO and RPO:
| Architecture | Description | Choose when |
|---|---|---|
| Active-passive | One cluster is active handling all traffic and the other is passive and ready to take over, with data replicated to the passive cluster | Applications need moderate RTO and RPO with simpler implementation and lower standby cost, accepting failover time and possible sync delay |
| Active-inactive | Inactive cluster is not used until a disaster event, with data regularly backed up rather than continuously replicated | Cost-sensitive environments allow higher RTO and RPO as cold disaster recovery, accepting activation time and risk that data goes out of date |
| Active-active | Both clusters are active handling traffic with load balancing and data replication between regions, using managed multi-regional services like Spanner and Cloud Storage where possible | Critical applications require minimal downtime with lowest RTO and RPO and continuous availability, accepting highest complexity, cost, and need for robust network and data synchronization |
Traffic flows from Cloud DNS and the load balancer to the active cluster, data flows from the primary region to the standby through synchronous replication within a region for HA or asynchronous replication across regions for disaster recovery (DR), and control depends on the data plane for business-critical operations rather than on management plane operations such as VM creation or identity and access management (IAM) permission updates.
Post-rollback assessment is the process of confirming that a system returned to a prior version or restored dataset actually works for users and meets recovery objectives. Assessment covers three questions supported by recovery testing: is data intact and usable, did recovery meet time and loss targets, and what must change to improve the next deployment. A rollback is not complete when traffic is switched; it is complete only after the full application stack is validated with the restored data and performance is back within expected bounds.
Full-stack verification means testing the entire deployed application and all critical infrastructure services with restored data, not only the database that was rolled back. The Cloud Healthcare API (opens in a new tab) example shows this pattern for a Fast Healthcare Interoperability Resources (FHIR) store: a rollback is parameterized by a mandatory point in time, optional operation-type and resource filters, and a required output destination in Cloud Storage (opens in a new tab) that records what changed. Before production recovery, teams run a dry run and inspect the dry-run output files to ensure the production recovery will run as expected, because the dry run predicts effects without modifying resources in the store.
Production verification follows an ordered recovery sequence where each step depends on the prior step succeeding. First, the recovery environment is created from automation such as a Deployment Manager template, then the most recent database backup and then transaction logs from Cloud Storage are applied to the database server. Then the team tests that the application works as expected by simulating user scenarios on the recovered environment, and only after tests succeed does traffic switch through Cloud DNS (opens in a new tab) to the recovered web tier. If issues appear on the new target after cutover, the fallback plan is treated as a full migration in reverse, including planning, testing, success criteria, and timeboxed execution.
Exam tip: A FHIR store dry run does not affect resources in the store, while production recovery requires the force field set to true and a recovery timestamp within the last 21 days in RFC 3339 format.
Recovery time objective (RTO) and recovery point objective (RPO) are the two time-based measures that define user impact after a rollback or disaster. RTO answers how long after a disaster before service is up and running, while RPO answers how much data can be lost, expressed as the age of the data that must be recoverable. Three criteria together judge a recovery test: data integrity, RTO, and RPO, and backup frequency must align with RPO so that intervals do not exceed the allowed loss window.
Judgment of success uses concrete thresholds and monitoring rather than general impressions:
For example, if RPO is 15 minutes, backups must run at least every 15 minutes, with near-continuous options such as point-in-time recovery (PITR) for Cloud SQL or incremental backups for large datasets for critical applications. If backup intervals exceed the defined RPO, Cloud Monitoring (opens in a new tab) is used to set up alerts, and overall uptime is checked against availability math where 99.9% allows about 86 seconds of downtime per day compared with 864 seconds for 99%.
Data integrity confirmation starts with automated consistency checks after each backup and restoration tests in a non-production environment. Backups are restored outside production to confirm they can be restored efficiently and that restored data meets application requirements, and restoration steps are documented so teams can execute them effectively during a failure. Health tracking uses the Google Cloud Backup and DR service or similar tools to confirm backups are stored securely, replicated across multiple regions for resilience, and available for rapid reuse.
The choice of recovery topology directly changes post-rollback user impact, cost, and complexity:
| Architecture | RTO and RPO posture | Tradeoff for users |
|---|---|---|
| Active-passive | Moderate RTO and RPO with data replicated to a passive cluster ready to take over | Simpler and lower standby cost, but failover time and sync delays extend outage |
| Active-inactive | Higher RTO and RPO with regular backups to an inactive cluster started only on disaster | Lowest operational cost when inactive, but activation, sync, and stale data increase impact |
| Active-active | Lowest RTO and RPO with both clusters active behind load balancing and replication | Continuous availability, but highest complexity, cost, and need for robust network and data sync |
This comparison explains why a warm pattern is often chosen as a balance between budget and availability, keeping a minimal operational database receiving asynchronous or semi-synchronous replication while avoiding the expense of full high availability. High availability (HA) generally applies to regional deployments with synchronous replication between zones and near-zero RTO and RPO, while disaster recovery (DR) generally applies to multi-region deployments with typically asynchronous replication that must be assessed for its effect on RTO and RPO.
Fallback analysis determines whether returning to the prior source preserved transactions and how long users were unavailable during the reverse move. In the simple fallback strategy, applications switch back to the original source database instance, which is appropriate when downtime during fallback is acceptable or when transactions committed on the new target do not need to be preserved. Because fallback can require significant effort and reverse replication to synchronize changes back to the source, production cutover should not occur until test results are satisfactory and both migration and fallback have been tested to avoid a severe outage.
Returning to the original production environment follows an explicit order that bounds user impact and prevents split writes. First, a backup of the database running in the recovery environment is taken and copied to production, then applied to the production database system. Then connections to the recovery application are prevented, which makes the application unavailable until restoration finishes, followed by copying and applying remaining transaction logs, switching Cloud DNS back to the original web service, verifying that continuous copying to Cloud Storage is operating, and deleting the temporary deployment. Documenting each step, training teams on execution, defining success criteria, timeboxing tasks, and running dry runs to measure expected task times turn the incident into improved deployment and rollback procedures for the next release.
Automated rollback procedures restore a previous stable infrastructure and application state without manual rebuilding when a deployment fails. In Google Cloud, the rollback depends on infrastructure as code (IaC) to recreate resources consistently, on versioned images and backups to restore data, and on automated triggers to reduce recovery time and human error. Automation ensures faster recovery from failures and more consistent results across zones and regions.
Automated infrastructure provisioning uses IaC tools like Terraform (opens in a new tab) to define, version, and redeploy the last known good configuration. A versioned IaC configuration acts as the source of truth for rollback, so recovery means re-applying a prior stable revision rather than manually editing live resources. This approach minimizes human errors during high-pressure incidents and lets teams return to service continuity quickly.
Recovery automation extends beyond re-applying templates. Eventarc can observe audit logs and automatically trigger remedial actions, while Workflows can orchestrate multi-step recovery sequences across services in order. Autoscaling increases cloud resource capacity automatically during failover to absorb shifted traffic, and platform engineering practices apply policies and guardrails consistently during redeployment. Together, the IaC definition provides the desired state, the event system provides the trigger, and the orchestration and scaling systems provide the execution path.
Google Cloud Deployment Manager (opens in a new tab) restores infrastructure by creating a deployment from a template that defines application servers, networks, and firewall rules. The template references previously configured custom images that match the production configuration, so each recovered server starts from the same operating system, binaries, and settings as before the failure. Teams must keep custom images versioned with the application and ensure the Deployment Manager template points to the latest stable image as part of the standard upgrade cycle.
For database servers, the custom image includes a startup script that automatically copies the latest backup from a Cloud Storage (opens in a new tab) bucket to the instance and then invokes the restore process. Compute Engine snapshots provide an additional mechanism to roll back persistent disks to a previous state, with snapshots stored in multi-region locations for resilience against zonal and regional loss. Because the network, firewall rules, images, and data-restore logic are all codified, the entire recovery environment can be recreated identically on demand.
A typical automated failover and rollback sequence runs in strict order:
Traffic shifts to the recovered environment only after restoration and testing succeed. Returning to the original production environment reverses the flow: take a backup from the recovery environment, copy it to production, apply it and any transaction logs, block connections to the temporary environment, repoint Cloud DNS, verify continuous replication to Cloud Storage, and then delete the temporary deployment.
Data protection during rollback depends on separating high availability (HA) from disaster recovery (DR) and choosing the correct replication model. HA applies to regional deployments with synchronous replication between zones, while DR applies to multi-region deployments that typically require an explicit asynchronous replication strategy. The choice directly controls the achievable recovery time objective (RTO) and recovery point objective (RPO).
| Approach | Scope and replication | RTO and RPO behavior |
|---|---|---|
| High availability (HA) | Single region, synchronous replication between zones by default; supports active-active topology with no single point of failure | Zero or near-zero RTO and RPO |
| Disaster recovery (DR) | Two or more regions, typically asynchronous replication unless using multi-regional or global services | RTO and RPO greater than zero; requires assessment of replication lag and manual or semi-automated failover steps |
Managed multi-regional services reduce data-loss risk during cross-region rollback. Cloud Spanner (opens in a new tab) and Cloud Storage provide built-in redundancy and synchronization across regions, while Cloud SQL high availability provides a near active-active topology with read replicas across zones and an RPO close to zero between regions. Teams should take snapshots of persistent disk data into multi-region locations, set up cross-region replication for regional or zonal resources, and use near-continuous options such as point-in-time recovery (PITR) for Cloud SQL or incremental backups for large datasets. Backup frequency must align with RPO; if the RPO is 15 minutes, backups must run at least every 15 minutes to limit transaction loss.
Validation confirms that a rollback restored both infrastructure and data correctly before users are affected. Backups must contain consistent and usable snapshots that can immediately bring applications back into service, verified by automated consistency checks after each backup. Restoration must be tested regularly in a non-production environment with the full application stack and critical infrastructure services, not just the database alone.
Successful recovery testing is judged on three related criteria:
Cloud Monitoring tracks adherence to RPO and generates alerts when backup intervals exceed the defined objective, while Google Cloud Backup and DR tracks backup health and confirms secure, replicated storage across regions. Combining backups with active-active failover or cross-region replication improves recovery time when backups alone cannot meet RTO. Regular testing, documented restoration steps, and trained execution ensure that the previous stable configuration is restored without data loss or prolonged service interruption.
Exam tip: HA is regional with synchronous replication and zero or near-zero RTO and RPO, while DR is multi-regional with typically asynchronous replication and non-zero RTO and RPO that must be explicitly planned.
Recovery time objective (RTO) answers how long after a disaster before the system is up and running, while recovery point objective (RPO) answers how much data can be lost. If RPO is 15 minutes, backups must run at least every 15 minutes, and Cloud Monitoring sends alerts when backup intervals exceed the defined RPO to feed the rollback decision.
Traffic should be shifted through Cloud DNS to the recovered environment only after the full application stack is validated with restored data by simulating user scenarios. Production cutover should not occur until test results are satisfactory because both the forward migration and the fallback must be tested to avoid a severe outage.
A production rollback requires a mandatory recovery point within the last 21 days in RFC 3339 format, a required Cloud Storage output destination, and force set to true. A dry run writes what would happen to Cloud Storage without affecting resources in the store, so teams should run the dry run and inspect its output files before recovering in production.
High availability (HA) applies to regional deployments with synchronous replication between zones for zero or near-zero recovery time objective (RTO) and recovery point objective (RPO), while disaster recovery (DR) applies to multi-region deployments with typically asynchronous replication and non-zero RTO and RPO. The choice directly controls the achievable RTO and RPO and requires assessment of replication lag and manual or semi-automated failover steps for disaster recovery (DR).
Your engineering team is designing a continuous deployment and rollback strategy for a critical transaction API hosted on Google Cloud. You need to establish rollback criteria that balance rapid automated mitigation against unwarranted rollbacks caused by ambient noise or external dependencies.
The deployment strategy must satisfy two core requirements:
Which operational criteria correctly distinguish between automated rollback triggers and manual escalation scenarios?
Automate rollback when memory utilization on canary instances reaches 70% during initial cache warm-up; escalate for manual intervention when HTTP 500 error rates exceed 15% across all canary traffic.
Automate rollback when canary health checks fail consecutively or SLI error rate burn rates exceed critical thresholds; escalate for manual intervention when business conversion rates drop without corresponding infrastructure errors or probe failures.
Automate rollback when database connection pool latency increases by 5 milliseconds within baseline bounds; escalate for manual intervention when canary pods enter a continuous CrashLoopBackOff state.
Automate rollback when Cloud Audit Logs detect IAM permission updates during deployment; escalate for manual intervention when load balancer backend service probes fail continuously for several minutes.
Last updated