Google Professional Cloud Database Engineer Question 151
Select 3Google Cloud PlatformYour organization has decided to migrate a PostgreSQL database hosted on Google Cloud's Cloud SQL to a new Cloud SQL instance in a different region. The database is 500 GB in size, and you want to minimize downtime during the migration. Which steps should you take to export and import the data efficiently while ensuring minimal downtime?
- A
Use the Cloud SQL export feature to export the database to a Cloud Storage bucket in SQL format.
- B
Use the Cloud SQL export feature to export the database to a Cloud Storage bucket in CSV format.
- C
Restore the new Cloud SQL instance using the database dump from the SQL file.
- D
Enable replication from the source Cloud SQL instance to the target Cloud SQL instance to synchronize the data.
- E
Stop writes to the source database, perform a final export, and restore the final dump on the target Cloud SQL instance.
Show answer and explanation
Correct answers: A, D, E
Explanation
To minimize downtime during the migration of a Cloud SQL PostgreSQL database to a new region, it's essential to combine methods like database export, replication, and a final export with stopped writes. Exporting in SQL format ensures compatibility, replication synchronizes most of the data in near real-time, and the final export ensures that no recent changes are lost during the switch to the new instance.
- A. Correct.
This is correct because exporting the database in SQL format ensures compatibility with Cloud SQL and retains the database schema and data.
- B. Incorrect.
This is incorrect because exporting in CSV format is not suitable for transferring both schema and data, and it is less efficient for this use case.
- C. Incorrect.
This is partially correct but incomplete. While restoring from a SQL dump is a valid step, additional steps like replication and a final export are required to minimize downtime.
- D. Correct.
This is correct because enabling replication allows for near real-time synchronization between the source and target databases, reducing downtime.
- E. Correct.
This is correct because stopping writes, performing a final export, and restoring the final dump ensures that the migration captures all recent changes with minimal downtime.