📖 Scenario: You work for a small company that wants to protect its data and applications from unexpected disasters like data center failures or accidental deletions. You will create a simple disaster recovery setup using Google Cloud Platform (GCP) to keep a backup of a storage bucket in another region.
🎯 Goal: Build a disaster recovery setup by creating a Cloud Storage bucket, configuring a backup bucket in a different region, and setting up a lifecycle rule to keep backups for 30 days.
📋 What You'll Learn
Create a Cloud Storage bucket named primary-bucket in the us-central1 region.
Create a backup Cloud Storage bucket named backup-bucket in the us-east1 region.
Configure a lifecycle rule on backup-bucket to delete objects older than 30 days.
💡 Why This Matters
🌍 Real World
Companies use disaster recovery strategies to protect data from loss due to failures or accidents by keeping backups in different locations.
💼 Career
Cloud engineers and administrators must know how to set up and manage backup storage and lifecycle policies to ensure data durability and compliance.
Progress0 / 4 steps
1
Create the primary Cloud Storage bucket
Write the gcloud command to create a Cloud Storage bucket named primary-bucket in the us-central1 region.
GCP
Hint
Use gcloud storage buckets create with --location to specify the region.
2
Create the backup Cloud Storage bucket
Write the gcloud command to create a Cloud Storage bucket named backup-bucket in the us-east1 region.
GCP
Hint
Use the same command as before but change the bucket name and region.
3
Configure lifecycle rule to delete old backups
Write a JSON lifecycle configuration that deletes objects older than 30 days. Save it to a file named lifecycle.json. The JSON must have a rule with action type Delete and a condition with age set to 30.
GCP
Hint
The JSON must have a rule array with one object containing action and condition.
4
Apply the lifecycle rule to the backup bucket
Write the gcloud command to apply the lifecycle configuration from lifecycle.json to the backup-bucket.
GCP
Hint
Use gcloud storage buckets update with --lifecycle-file to apply the rule.
Practice
(1/5)
1. What is the main goal of a disaster recovery strategy in cloud infrastructure?
easy
A. To improve user interface design
B. To keep services running during unexpected problems
C. To increase the speed of data processing
D. To reduce the cost of cloud services
Solution
Step 1: Understand disaster recovery purpose
Disaster recovery aims to keep systems available and data safe during failures or disasters.
Step 2: Identify the main goal
The main goal is to maintain service uptime and data integrity despite problems.
Final Answer:
To keep services running during unexpected problems -> Option B
Quick Check:
Disaster recovery = keep services safe [OK]
Hint: Disaster recovery means service stays up during trouble [OK]
Common Mistakes:
Confusing disaster recovery with cost saving
Thinking it improves speed or UI
Ignoring service availability
2. Which GCP service is commonly used to store backups for disaster recovery?
easy
A. Cloud Pub/Sub
B. Google Compute Engine
C. Google Kubernetes Engine
D. Google Cloud Storage
Solution
Step 1: Identify backup storage service
Backups need durable, scalable storage. Google Cloud Storage is designed for this.
Step 2: Exclude compute and messaging services
Compute Engine and Kubernetes Engine run workloads, Pub/Sub handles messaging, not backups.
Final Answer:
Google Cloud Storage -> Option D
Quick Check:
Backup storage = Cloud Storage [OK]
Hint: Backups go to Cloud Storage, not compute or messaging [OK]
Common Mistakes:
Choosing compute services for backup storage
Confusing messaging service with storage
Not knowing Cloud Storage purpose
3. Consider this GCP setup code snippet for disaster recovery:
What is the main benefit of this configuration for disaster recovery?
medium
A. It creates two instances in different zones to improve availability
B. It reduces the cost by using smaller machines
C. It backs up data automatically to Cloud Storage
D. It enables faster network speed between instances
Solution
Step 1: Analyze instance zones
The two instances are in different zones (us-central1-a and us-central1-b), which protects against zone failure.
Step 2: Identify disaster recovery benefit
Having instances in separate zones improves availability and fault tolerance during disasters.
Final Answer:
It creates two instances in different zones to improve availability -> Option A
Quick Check:
Multi-zone instances = better availability [OK]
Hint: Different zones mean better uptime during failures [OK]
Common Mistakes:
Assuming cost reduction is main goal
Thinking data backup happens automatically
Confusing network speed with disaster recovery
4. You have a disaster recovery plan that uses snapshots for backups. After a disaster, the recovery fails because snapshots are missing. What is the most likely error?
medium
A. Snapshots were stored in the same zone as the primary data
B. Snapshots were not scheduled regularly
C. Snapshots were encrypted with the wrong key
D. Snapshots were created from the wrong disk
Solution
Step 1: Understand snapshot storage risk
If snapshots are stored only in the same zone, a zone failure can destroy both primary data and backups.
Step 2: Identify cause of missing snapshots
Storing snapshots in the same zone risks losing them during a disaster affecting that zone.
Final Answer:
Snapshots were stored in the same zone as the primary data -> Option A
Quick Check:
Backups must be in different zones [OK]
Hint: Backups in same zone vanish with disaster [OK]
Common Mistakes:
Ignoring backup location importance
Assuming encryption or disk choice caused failure
Not scheduling snapshots regularly
5. You want to design a disaster recovery plan for a critical GCP application that must recover within minutes after a regional outage. Which combination of strategies is best?
hard
A. Use multi-zone deployment with weekly snapshots and manual recovery
B. Use single-zone deployment with daily manual backups to Cloud Storage
C. Use multi-region deployment with automated failover and continuous data replication
D. Use single-region deployment with monthly backups and no failover
Solution
Step 1: Identify recovery time objective (RTO)
Recovery within minutes requires fast failover and minimal data loss.
Step 2: Evaluate strategies for fast recovery
Multi-region deployment with automated failover and continuous replication ensures quick switch and up-to-date data.
Step 3: Compare with other options
Single-zone or single-region with manual backups are slower and risk data loss; weekly or monthly backups are too infrequent.
Final Answer:
Use multi-region deployment with automated failover and continuous data replication -> Option C
Quick Check:
Fast recovery needs multi-region + automation [OK]
Hint: Fast recovery needs multi-region and automation [OK]
Common Mistakes:
Choosing single-zone or single-region for critical apps
Relying on manual backups for quick recovery
Ignoring continuous data replication
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.