PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #26
You work in the logistics department. Your data analysis team needs daily extracts from Cloud SQL for MySQL to train a machine learning model. The model will be used to optimize next-day routes. You…
The correct answer is B. Use Cloud Scheduler to trigger a Cloud Function through Pub/Sub to call the. The Google-recommended approach for scheduled Cloud SQL exports is to use Cloud Scheduler to trigger a Cloud Function via Pub/Sub, which then calls the cloudsql.instances.export REST API. This is preferred because the export API offloads the export process from the Cloud SQL…
Question
You work in the logistics department. Your data analysis team needs daily extracts from Cloud SQL for MySQL to train a machine learning model. The model will be used to optimize next-day routes. You need to export the data in CSV format. You want to follow Google-recommended practices. What should you do?
Options
- AUse Cloud Scheduler to trigger a Cloud Function that will run a select * from table(s) query to call
- BUse Cloud Scheduler to trigger a Cloud Function through Pub/Sub to call the
- CUse Cloud Composer to orchestrate an export by calling the cloudsql.instances.export API.
- DUse Cloud Composer to execute a select * from table(s) query and export results.
How the community answered
(26 responses)- A8% (2)
- B73% (19)
- C15% (4)
- D4% (1)
Explanation
The Google-recommended approach for scheduled Cloud SQL exports is to use Cloud Scheduler to trigger a Cloud Function via Pub/Sub, which then calls the cloudsql.instances.export REST API. This is preferred because the export API offloads the export process from the Cloud SQL instance itself (it uses a serverless export mechanism), minimizing impact on production workloads. Using Pub/Sub as the intermediary between Cloud Scheduler and Cloud Function provides a reliable, decoupled trigger mechanism with built-in retry logic. Option A bypasses the export API and runs a direct SELECT query from a function, which places load on the instance and doesn't produce a managed export. Options C and D use Cloud Composer, which is a heavier, more expensive orchestration platform (Apache Airflow) that is overkill for a simple daily export task.
Topics
Community Discussion
No community discussion yet for this question.