nerdexam
Google

PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #100

You want to migrate an on-premises mission-critical PostgreSQL database to Cloud SQL. The database must be able to withstand a zonal failure with less than five minutes of downtime and still not…

The correct answer is D. Enable high availability (HA) for the database to make it regional. Enabling high availability (HA) on a Cloud SQL instance creates a standby replica with synchronous replication in a secondary zone, providing automatic failover in under 60 seconds with zero data loss during a zonal failure.

Ensuring solution reliability

Question

You want to migrate an on-premises mission-critical PostgreSQL database to Cloud SQL. The database must be able to withstand a zonal failure with less than five minutes of downtime and still not lose any transactions. You want to follow Google-recommended practices for the migration. What should you do?

Options

  • ATake nightly snapshots of the primary database instance, and restore them in a secondary zone.
  • BBuild a change data capture (CDC) pipeline to read transactions from the primary instance, and
  • CCreate a read replica in another region, and promote the read replica if a failure occurs.
  • DEnable high availability (HA) for the database to make it regional.

How the community answered

(52 responses)
  • A
    8% (4)
  • B
    17% (9)
  • C
    4% (2)
  • D
    71% (37)

Why each option

Enabling high availability (HA) on a Cloud SQL instance creates a standby replica with synchronous replication in a secondary zone, providing automatic failover in under 60 seconds with zero data loss during a zonal failure.

ATake nightly snapshots of the primary database instance, and restore them in a secondary zone.

Nightly snapshots introduce an RPO of up to 24 hours because transactions occurring after the last snapshot would be lost; restoring a snapshot also takes far longer than 5 minutes.

BBuild a change data capture (CDC) pipeline to read transactions from the primary instance, and

Building a custom CDC pipeline is not a Google-recommended practice for zonal HA in Cloud SQL and adds significant operational complexity compared to the built-in HA feature.

CCreate a read replica in another region, and promote the read replica if a failure occurs.

A read replica in another region uses asynchronous replication, meaning some committed transactions may not yet be replicated at the time of failure, causing data loss that violates the zero-transaction-loss requirement.

DEnable high availability (HA) for the database to make it regional.Correct

Cloud SQL HA uses a regional configuration with a primary instance in one zone and a standby instance in another zone within the same region, connected via synchronous replication. In the event of a zonal failure, Cloud SQL automatically promotes the standby with no manual intervention, completing failover in well under 5 minutes with no committed transactions lost - satisfying both the RTO and RPO requirements.

Concept tested: Cloud SQL high availability for zonal failover with zero data loss

Source: https://cloud.google.com/sql/docs/mysql/high-availability

Topics

#Cloud SQL High Availability#Database Resilience#RTO/RPO#Zonal Failure

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DATABASE-ENGINEER Practice