Google Professional Cloud Database Engineer Question 206
Single answerGoogle Cloud PlatformYour company needs to migrate a MySQL database from an on-premises data center to Cloud SQL for MySQL on Google Cloud. The migration must minimize downtime and ensure data consistency. Which migration approach should you use?
- A
Export the database as SQL dump files and import them into Cloud SQL.
- B
Use the Database Migration Service (DMS) with a continuous replication setup.
- C
Manually copy the database files to a Google Cloud Storage bucket and import them into Cloud SQL.
- D
Set up a VPN and replicate the database using a custom replication script.
Show answer and explanation
Correct answer: B
Explanation
Using the Database Migration Service (DMS) with continuous replication is the most efficient and reliable way to migrate MySQL databases to Cloud SQL while minimizing downtime and ensuring data consistency. DMS is purpose-built for such migrations and provides features like real-time replication and automated cutover, reducing the risk of errors and manual effort.
- A. Incorrect.
Exporting and importing SQL dump files can be a straightforward solution, but it may involve significant downtime and does not support continuous replication, which is necessary for minimizing downtime and ensuring consistency during the migration.
- B. Correct.
Database Migration Service (DMS) with continuous replication is the best approach for minimizing downtime and ensuring data consistency. It allows you to replicate data changes in real-time until the final cutover.
- C. Incorrect.
Manually copying database files and importing them is not a supported or recommended method for migrating databases to Cloud SQL. This approach lacks automation and consistency guarantees.
- D. Incorrect.
Setting up a VPN and using a custom replication script can be complex and error-prone compared to using a managed service like Database Migration Service (DMS). It also requires additional effort to maintain connectivity and consistency during the migration.