Question

Difficulty: EasyPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

A software team needs to run a lightweight event-driven code snippet in Python whenever a new file is uploaded to a Cloud Storage bucket. The execution takes only a few seconds, and the team wants to deploy raw source code directly without managing container images or underlying infrastructure. Which Google Cloud compute service should they choose?

  1. Cloud FunctionsAnswer
  2. B
    Cloud Run
  3. C
    Compute Engine
  4. D
    Google Kubernetes Engine (GKE)

Answer

Cloud Functions is the best serverless choice for executing lightweight, event-driven code in response to Cloud Storage events without container management.
Cloud Functions provides a serverless execution environment designed specifically to run event-driven code in response to Cloud Storage triggers, allowing deployment of source code directly with zero container maintenance.

Step-by-Step Solution

1
Identify the key operational requirements
The scenario requires executing short-lived Python code triggered by Cloud Storage file uploads without creating container images.
Understanding operational constraints helps determine the exact serverless compute paradigm needed.
2
Compare serverless execution models
Cloud Functions accepts raw code directly and natively integrates with Cloud Storage event triggers, whereas Cloud Run requires containerized deployments.
Matching GCP service features to developer workflow preferences minimizes operational overhead.

Key Concept

Selecting Cloud Functions for lightweight event-driven snippets vs Cloud Run for containerized applications.
Rate this question