Google Professional Cloud Database Engineer Question 149
Select 3Google Cloud PlatformYour team is migrating a MySQL database hosted on Google Cloud SQL to a new Cloud SQL instance in a different region. You need to export the data from the current instance and import it into the new instance while ensuring minimal downtime and data integrity. Which steps should you follow to achieve this?
- A
Use the Cloud SQL export feature to export the database to a Cloud Storage bucket as a SQL dump file.
- B
Export the database using
mysqldumpand store the dump file on a local machine before uploading it to Cloud Storage. - C
Import the SQL dump file directly into the new Cloud SQL instance using the Cloud SQL import feature.
- D
Use the
mysqlimportcommand-line tool to directly import the SQL dump file from your local machine to the new Cloud SQL instance. - E
Ensure the Cloud Storage bucket is in the same region as the target Cloud SQL instance to optimize performance during the import.
Show answer and explanation
Correct answers: A, C, E
Explanation
The recommended approach for migrating a Cloud SQL database to another instance in a different region involves using the Cloud SQL export and import features. These features are optimized for transferring data between instances while ensuring data integrity and minimal downtime. Additionally, using a Cloud Storage bucket in the same region as the target instance improves the performance of the import operation. Avoid unnecessary steps, such as transferring data to a local machine, as this can introduce potential risks and inefficiencies.
- A. Correct.
Correct: Using the Cloud SQL export feature ensures a reliable and optimized process for exporting the database to a Cloud Storage bucket, preserving data integrity.
- B. Incorrect.
Incorrect: While
mysqldumpcan be used, exporting to a local machine adds unnecessary steps and potential risks of data loss or corruption during the upload process. - C. Correct.
Correct: The Cloud SQL import feature is designed to handle SQL dump files stored in Cloud Storage effectively, ensuring compatibility and ease of use.
- D. Incorrect.
Incorrect: The
mysqlimportcommand-line tool is not designed for importing SQL dump files directly into Cloud SQL and would require additional configurations and steps. - E. Correct.
Correct: Placing the Cloud Storage bucket in the same region as the target Cloud SQL instance reduces latency and improves performance during the import process.