Google Professional Cloud Database Engineer Question 200
Single answerGoogle Cloud PlatformYour team manages a Cloud SQL PostgreSQL database and needs to schedule regular backups of the data for disaster recovery. The requirement is to export the database daily to a Cloud Storage bucket in the same project, and the solution should involve minimal manual intervention. Which approach should you use to meet this requirement?
- A
Create a Cloud SQL export operation and schedule it using Cloud Scheduler.
- B
Set up a cron job on a Compute Engine VM to export the database and upload it to Cloud Storage.
- C
Enable automated backups for the Cloud SQL instance and configure a custom script to copy backups to Cloud Storage.
- D
Use the Cloud SQL export feature with a Cloud Function triggered by a Pub/Sub topic to export the database daily.
Show answer and explanation
Correct answer: A
Explanation
The best solution for scheduling database exports is to use Cloud SQL's export functionality in combination with Cloud Scheduler. This approach is straightforward, fully managed, and minimizes operational overhead. Other options introduce unnecessary complexity or do not fully meet the requirements.
- A. Correct.
This is the correct answer. You can create a Cloud SQL export operation to export the database to a Cloud Storage bucket. By combining this with Cloud Scheduler, you can automate the process to run daily with minimal manual intervention.
- B. Incorrect.
This option is overly complex and requires maintaining a Compute Engine VM and a custom cron job. While it might work, it does not leverage managed services or follow best practices for Google Cloud.
- C. Incorrect.
Automated backups are useful for recovery but do not fulfill the requirement of exporting the database to a Cloud Storage bucket. Additionally, using a custom script adds unnecessary complexity.
- D. Incorrect.
While you can use a Cloud Function and Pub/Sub to trigger exports, this is more complex than necessary and does not align with the simplicity of combining Cloud SQL export with Cloud Scheduler.