Google Professional Cloud Database Engineer Question 199
Single answerGoogle Cloud PlatformYou are managing a Cloud SQL instance and need to schedule automated exports of your database to a Cloud Storage bucket for backup purposes. The export should occur daily at midnight and include only specific tables. Which approach should you take?
- A
Use a Cloud Scheduler job to trigger a Cloud Function that executes the export operation.
- B
Configure a scheduled task directly within the Cloud SQL instance to perform the export.
- C
Leverage the
gcloud sql exportcommand with a cron job on a Compute Engine instance. - D
Set up the automated export schedule directly in the Cloud SQL settings.
Show answer and explanation
Correct answer: A
Explanation
To schedule database exports in Google Cloud, the best practice is to use Cloud Scheduler in combination with a Cloud Function or other tools that can call the Cloud SQL Admin API for export operations. This approach allows for flexible scheduling and ensures that you can include specific tables in the export. While other methods like using Compute Engine are feasible, they are not resource-efficient or aligned with recommended practices.
- A. Correct.
This is the correct approach. Cloud Scheduler can be used to trigger a Cloud Function, which can execute the export operation using the Cloud SQL Admin API. This provides flexibility for scheduling and customization of the export process.
- B. Incorrect.
This is incorrect. Cloud SQL does not have a built-in feature to schedule exports directly. You need to use external tools like Cloud Scheduler or a custom script.
- C. Incorrect.
While this method is possible, it is less efficient and requires managing Compute Engine resources unnecessarily. It is not the recommended or best practice approach on Google Cloud.
- D. Incorrect.
This is incorrect because Cloud SQL settings do not have an option to natively configure automated export schedules. External scheduling tools are required.