Google Professional Cloud Database Engineer Question 205
Single answerGoogle Cloud PlatformYour organization needs to migrate a 5 TB MySQL database from an on-premises data center to Cloud SQL on Google Cloud with minimal downtime. The database is actively used, and data changes frequently during the migration process. Which approach would best meet the requirements for this migration?
- A
Use the Cloud SQL import/export functionality to transfer the database into Cloud SQL.
- B
Set up a database replication pipeline using the Database Migration Service (DMS) and perform a cutover once replication is in sync.
- C
Use a custom data migration script to extract data from the on-premises database and import it into Cloud SQL.
- D
Take a full backup of the on-premises database, upload it to Cloud Storage, and restore it into Cloud SQL.
Show answer and explanation
Correct answer: B
Explanation
The Database Migration Service (DMS) is designed for migrating databases like MySQL with minimal downtime. By setting up replication, DMS can synchronize the on-premises database with the Cloud SQL instance, allowing for a seamless cutover at a convenient time with minimal disruption to the application's operations.
- A. Incorrect.
This approach is not suitable as the Cloud SQL import/export functionality only supports non-real-time migrations and does not handle frequent data changes effectively.
- B. Correct.
This is the correct option. The Database Migration Service (DMS) supports setting up replication for MySQL databases, allowing near-zero-downtime migrations by keeping the source and target databases in sync until a planned cutover.
- C. Incorrect.
While a custom script could work, it would require significant manual effort and would likely not handle frequent data changes well, leading to potential data loss or inconsistencies.
- D. Incorrect.
This approach involves high downtime as the data is static from the moment the backup is taken until it is restored and operational in Cloud SQL, making it unsuitable for minimizing downtime in active use cases.