Google Professional Cloud Database Engineer Question 204
Single answerGoogle Cloud PlatformYour company needs to migrate a PostgreSQL database from an on-premises data center to Google Cloud. The database is critical for business operations, and downtime must be minimized during the migration. Which approach would best ensure a successful migration with minimal downtime?
- A
Use a one-time dump of the database using pg_dump, transfer the dump to Cloud Storage, and restore it in Cloud SQL.
- B
Set up a Database Migration Service (DMS) continuous replication job to sync data from the on-premises PostgreSQL to a Cloud SQL instance.
- C
Export the database as a set of CSV files, upload them to BigQuery, and recreate the database schema manually in Cloud SQL.
- D
Perform a live migration using a VM snapshot of the database server and import it into Cloud SQL.
Show answer and explanation
Correct answer: B
Explanation
To minimize downtime during the migration of a PostgreSQL database from an on-premises environment to Google Cloud, Database Migration Service (DMS) is the most appropriate choice. It supports continuous replication, allowing the source and target databases to remain synchronized until the final cutover, ensuring minimal disruption to business operations.
- A. Incorrect.
While using pg_dump is a valid method for migrating data, it involves significant downtime because the database must be stopped during the dump and restore process. This approach does not meet the requirement of minimal downtime.
- B. Correct.
Database Migration Service (DMS) enables continuous replication from the source database to the target Cloud SQL instance, ensuring minimal downtime and seamless migration. This is the best choice for the scenario described.
- C. Incorrect.
Exporting the database as CSV files and manually recreating the schema is time-consuming and prone to errors. Additionally, it does not provide a mechanism for continuous replication or minimal downtime.
- D. Incorrect.
Live migration using a VM snapshot is not supported for database migrations to Cloud SQL. Snapshots are typically used for VM migrations, not database-specific workloads.