nerdexam
Google

PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #55

You use Python scripts to generate weekly SQL reports to assess the state of your databases and determine whether you need to reorganize tables or run statistics. You want to automate this report…

The correct answer is C. Create a Cloud Function, and call the Cloud Function using Cloud Scheduler. Cloud Functions (serverless) combined with Cloud Scheduler (managed cron) is the lowest-overhead and most cost-effective solution for a periodic, short-lived Python task. You pay only for the execution time of the function, and there are no servers to manage. A Compute Engine…

Managing Database Operations

Question

You use Python scripts to generate weekly SQL reports to assess the state of your databases and determine whether you need to reorganize tables or run statistics. You want to automate this report but need to minimize operational costs and overhead. What should you do?

Options

  • ACreate a VM in Compute Engine, and run a cron job.
  • BCreate a Cloud Composer instance, and create a directed acyclic graph (DAG).
  • CCreate a Cloud Function, and call the Cloud Function using Cloud Scheduler.
  • DCreate a Cloud Function, and call the Cloud Function from a Cloud Tasks queue.

How the community answered

(30 responses)
  • A
    17% (5)
  • B
    3% (1)
  • C
    70% (21)
  • D
    10% (3)

Explanation

Cloud Functions (serverless) combined with Cloud Scheduler (managed cron) is the lowest-overhead and most cost-effective solution for a periodic, short-lived Python task. You pay only for the execution time of the function, and there are no servers to manage. A Compute Engine VM with a cron job (A) requires provisioning, patching, and paying for 24/7 compute even when idle. Cloud Composer (B) is a fully managed Apache Airflow service that is powerful but significantly more expensive and operationally heavier - it is overkill for a simple weekly script. Cloud Tasks (D) is designed for asynchronous task queues and fan-out, not for time-based scheduling of recurring jobs.

Topics

#Serverless Computing#Scheduled Automation#Cloud Functions#Cloud Scheduler

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DATABASE-ENGINEER Practice