CLOUD-DATABASE-ENGINEER practice question 17 of 25

You are migrating an on-premises application to Google Cloud. The application requires a high availability (HA) PostgreSQL database to support…

Full set: 141 questions
You are migrating an on-premises application to Google Cloud. The application requires a high availability (HA) PostgreSQL database to support business-critical functions. Your company's disaster recovery strategy requires a recovery time objective (RTO) and recovery point objective (RPO) within 30 minutes of failure. You plan to use a Google Cloud managed service. What should you do to maximize uptime for your application?
Answer options
A: Deploy Cloud SQL for PostgreSQL in a regional configuration. Create a read replica in a different zone in the same region and a read replica in another region for disaster recovery.
B: Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Take periodic backups, and use this backup to restore to a new Cloud SQL for PostgreSQL instance in another region during a disaster recovery event.
C: Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Create a cross- region read replica, and promote the read replica as the primary node for disaster recovery. Correct answer
D: Migrate the PostgreSQL database to multi-regional Cloud Spanner so that a single region outage will not affect your application. Update the schema to support Cloud Spanner data types, and refactor the application.
Correct Answer:
C. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Create a cross- region read replica, and promote the read replica as the primary node for disaster recovery.
Explanation

This solution effectively addresses both high availability (HA) and disaster recovery (DR) requirements. Enabling the HA configuration on Cloud SQL for PostgreSQL creates a primary and a standby instance in different zones within the same region. This provides automatic, synchronous failover in the event of a zonal failure, maximizing uptime. For disaster recovery against a regional outage, a cross-region read replica is the optimal strategy. This replica is kept up-to-date via asynchronous replication. In a disaster, it can be promoted to a primary, writable instance quickly, which is crucial for meeting the strict 30-minute RTO and RPO requirements.

Why Incorrect

A. A zonal read replica does not provide automatic failover like the built-in HA feature, leading to a longer recovery time and more manual intervention for zonal failures.
B. Restoring from a backup for disaster recovery can be time-consuming, especially for large databases, and is likely to violate the 30-minute RTO. The RPO is also higher.
D. Migrating to Cloud Spanner is a major architectural change requiring significant schema updates and application refactoring, which is not a direct migration of a PostgreSQL application.

References

1. Cloud SQL for PostgreSQL High Availability: Google Cloud Documentation, "High availability configuration". This document explains that the HA configuration provides a standby instance in a different zone for automatic failover. It states, "If an HA-configured instance becomes unresponsive, Cloud SQL automatically switches to serving data from the standby instance."

Source: https://cloud.google.com/sql/docs/postgres/high-availability, Section: "Overview of the HA configuration".

2. Cloud SQL for PostgreSQL Disaster Recovery: Google Cloud Documentation, "Disaster recovery guide for Cloud SQL". This guide explicitly recommends cross-region read replicas for DR. It states, "For a regional disaster recovery solution for Cloud SQL, you can set up a cross-region read replica... In the event of a regional failure, you can promote the read replica in your disaster recovery region."

Source: https://cloud.google.com/sql/docs/postgres/disaster-recovery-guide, Section: "Disaster recovery architecture".

3. Comparison of DR Strategies: The same disaster recovery guide compares using a cross-region replica versus backup and restore. It notes that the replica promotion method has a lower RTO (minutes) and RPO (seconds to minutes) compared to the backup and restore method, which has an RTO of minutes to hours.

Source: https://cloud.google.com/sql/docs/postgres/disaster-recovery-guide, Section: "Disaster recovery options".

4. Migration to Cloud Spanner Complexity: Google Cloud Documentation, "PostgreSQL to Cloud Spanner migration overview". This document outlines the complex process of migrating, which includes schema and data type mapping, application code changes, and performance tuning, confirming that it is not a simple lift-and-shift migration.

Source: https://cloud.google.com/spanner/docs/migrate/postgres-spanner-overview, Section: "Migration journey".

Scroll to Top