A developer needs to trigger a serverless function whenever a new file is uploaded to a Cloud Storage bucket. The function will process the file and store results in Firestore. Which Google Cloud service should they use for the function?
Cloud Functions is a purpose-built, event-driven serverless compute platform that natively responds to GCP events, including Cloud Storage object finalization (e.g., the 'google.storage.object.finalize' trigger). When an object is uploaded, Cloud Functions automatically invokes the function with the event metadata, scaling to zero when idle and managing all infrastructure transparently. This aligns exactly with the requirement to trigger a single-purpose serverless function on a storage event, without needing a container runtime, a web server, or an intermediary like Pub/Sub.
Why this answer
Cloud Functions is an event-driven serverless compute service that can be triggered by Cloud Storage events.