Google Professional Cloud Database Engineer Question 201
Single answerGoogle Cloud PlatformYou are managing a Cloud SQL database instance for a retail application and need to set up regular daily exports of the database to a Google Cloud Storage bucket for backup purposes. Which approach should you take to schedule these exports while ensuring minimal operational overhead?
- A
Use a Cloud SQL export operation scheduled via a Cloud Scheduler job with a Pub/Sub trigger.
- B
Manually trigger an export operation in the Cloud SQL console each day.
- C
Use a Cloud SQL export operation and configure it directly to run on a daily schedule within the Cloud SQL settings.
- D
Write a custom script to trigger the export operation and deploy it using a Compute Engine instance with a cron job.
Show answer and explanation
Correct answer: A
Explanation
To schedule recurring database exports in Cloud SQL, the recommended approach is to use Cloud Scheduler to automate the export process. Cloud Scheduler can trigger a Cloud Function or Pub/Sub event that initiates the export operation. This method minimizes operational overhead and leverages Google Cloud's native services for automation. Other options, like manual exports or deploying custom scripts on Compute Engine, are either inefficient or more complex to manage.
- A. Correct.
This is the correct approach. You can use Cloud Scheduler to automate the export process by invoking a Cloud Function or Pub/Sub-triggered process to initiate the Cloud SQL export operation. This ensures minimal operational overhead.
- B. Incorrect.
This is incorrect because manually triggering exports every day is not efficient and introduces a risk of human error, especially in a production environment.
- C. Incorrect.
This is incorrect because Cloud SQL does not natively support configuring scheduled exports directly within its settings. A separate service is required for scheduling recurring tasks.
- D. Incorrect.
This is incorrect because using a custom script and Compute Engine introduces unnecessary complexity and maintenance overhead when simpler solutions like Cloud Scheduler and Pub/Sub are available.