Google Professional Cloud Database Engineer Question 221
Select 3Google Cloud PlatformYou are tasked with migrating an on-premises MySQL database to Cloud SQL for MySQL. The database has a complex schema with multiple tables, foreign keys, and stored procedures. The migration must minimize downtime and include a fallback plan in case of failure. Which of the following steps should you include in your migration plan?
- A
Use the Database Migration Service (DMS) to set up a continuous replication pipeline before cutover.
- B
Perform a schema conversion test in a development environment before the actual migration.
- C
Manually rebuild the schema on Cloud SQL and import the data using CSV files.
- D
Plan for a rollback by keeping a backup of the source database before migration.
- E
Shut down the source database before the migration to avoid conflicts.
Show answer and explanation
Correct answers: A, B, D
Explanation
A successful database migration plan to Cloud SQL should prioritize minimizing downtime while ensuring data integrity and compatibility. Using Database Migration Service for continuous replication allows for a smooth cutover with minimal downtime. Testing the schema conversion ensures there are no compatibility issues, and keeping a backup of the source database provides a fallback in case of migration failure. Manual methods like CSV imports or shutting down the database unnecessarily introduce risks or downtime, making them unsuitable for this scenario.
- A. Correct.
Using Database Migration Service (DMS) with continuous replication ensures near-zero downtime during the migration. This is a best practice for migrating MySQL databases to Cloud SQL.
- B. Correct.
Performing a schema conversion test ensures that the database schema and objects (e.g., tables, foreign keys, stored procedures) are compatible with Cloud SQL and avoids runtime issues during migration.
- C. Incorrect.
Manually rebuilding the schema and importing data via CSV files is error-prone and not ideal for complex schemas or large datasets. Automated tools like DMS are recommended.
- D. Correct.
Maintaining a backup of the source database ensures you can roll back to the original state in case of a migration failure, which is a critical component of any fallback plan.
- E. Incorrect.
Shutting down the source database before migration can lead to unnecessary downtime and should be avoided if the goal is to minimize downtime.