A small team wants to run a short piece of code whenever a file is uploaded to a Cloud Storage bucket, without provisioning or managing servers or containers. Which service is designed for this?
Show answer and explanation
Answer: D
Cloud Functions is Google Cloud's serverless functions service. You write a handler and bind it to an event source, such as a Cloud Storage object finalize event, an HTTP request, or a Pub/Sub message. Google provisions and scales the runtime automatically, so the team manages no servers, and billing follows executions rather than continuously running instances.
Why the other options are wrong
- A. Dataproc runs managed Spark and Hadoop clusters for large batch analytics. Standing up a cluster to react to single uploads is far heavier than the scenario needs, and it requires cluster management.
- B. Managed instance groups keep a fleet of VMs running and scale them by policy. The team would still manage machine images and capacity, which the serverless requirement rules out.
- C. Polling is not event-driven, so reactions are delayed, and the team would still maintain a VM. Storage events can invoke a function directly, which removes both the polling and the server.