CLOUD-DATABASE-ENGINEER practice question 8 of 25

Your customer is running a MySQL database on-premises with read replicas. The nightly incremental backups are expensive and add maintenance overhead. You want to follow Google-recommended practices to migrate the database to Google Cloud, and you need to ensure minimal downtime. What should you do?

Full set: 141 questions
Answer options
A: Create a Google Kubernetes Engine (GKE) cluster, install MySQL on the cluster, and then import the dump file.
B: Use the mysqldump utility to take a backup of the existing on-premises database, and then import it into Cloud SQL.
C: Create a Compute Engine VM, install MySQL on the VM, and then import the dump file.
D: Create an external replica, and use Cloud SQL to synchronize the data to the replica. Correct answer
Correct Answer:
D. Create an external replica, and use Cloud SQL to synchronize the data to the replica.
Explanation

Creating an external replica is the Google-recommended practice for migrating a MySQL database to Cloud SQL with minimal downtime. This method involves configuring the on-premises database as the source and the new Cloud SQL instance as the replica. Data is continuously synchronized while the source application remains online. Once the replica is caught up, a brief cutover window is used to promote the Cloud SQL instance to a primary and redirect application traffic. This process significantly reduces the downtime compared to offline methods like dump and import, and it moves the database to a fully managed service, which addresses the customer's concerns about backup and maintenance overhead.

Why Incorrect

A. Creating a GKE cluster to run MySQL is a self-managed solution that increases operational complexity and does not reduce the maintenance overhead as effectively as a managed service.
B. Using the mysqldump utility constitutes an offline migration. This requires taking the application offline for the duration of the data dump and import, which does not meet the minimal downtime requirement.
C. Installing MySQL on a Compute Engine VM is another self-managed approach. It shifts the maintenance burden to the cloud but does not eliminate it, contrary to the goal of reducing overhead. ---

References

1. Google Cloud Documentation, "Migrating data from an external server to Cloud SQL": This document explicitly outlines the process for minimal downtime migration. It states, "To migrate your data from an external MySQL server to Cloud SQL with minimal downtime, you can set up your external server as the source for replication to a Cloud SQL replica." This directly supports the chosen answer (D).

2. Google Cloud Documentation, "Migration strategies for MySQL": This page compares different migration strategies. It categorizes the "External replica" method under "Continuous replication for minimal downtime migrations," while categorizing "Export and import files" (using mysqldump) as a method with higher downtime. This confirms that option D is superior to B for the stated requirement.

3. Google Cloud Documentation, "About importing and exporting data": This page describes the dump file method. It notes, "Importing data into Cloud SQL overwrites all existing data in the target database." This implies the database is unavailable for writes during the import, confirming that this method incurs significant downtime, making option B incorrect.

4. Google Cloud Documentation, "Cloud SQL for MySQL features": This page details the benefits of Cloud SQL as a fully managed service, including "Automated backups" and "Automated maintenance." This supports the reasoning that moving to Cloud SQL (as in option D) reduces maintenance overhead, while self-managing on GKE or Compute Engine (options A and C) does not.

Scroll to Top