Question

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

An enterprise engineering team is planning the serverless compute components for a data ingestion and reporting pipeline on Google Cloud. The system must meet two distinct operational requirements:

1. A containerized Go microservice that handles incoming HTTP webhooks, requires request concurrency (handling up to 80 requests simultaneously per instance), and processes long-running reporting jobs that can take up to 45 minutes per request.
2. A lightweight event-driven snippet written in Python that executes quickly whenever a new message is published to a Cloud Pub/Sub topic to log metadata in a database.

Which TWO serverless compute deployment decisions should the team make to satisfy these requirements? (Select TWO)

  1. Deploy the containerized Go microservice to Cloud Run because it supports custom container images, request concurrency of multiple requests per instance, and HTTP execution timeouts of up to 60 minutes.Answer
  2. Deploy the Python script as a Cloud Function with a Cloud Pub/Sub trigger because it provides a simplified, event-driven execution environment ideal for single-purpose code snippets reacting to Pub/Sub events.Answer
  3. C
    Deploy the containerized Go microservice to Cloud Functions (1st generation) because 1st generation functions natively support multi-concurrency and up to 60-minute execution timeouts for custom containers.
  4. D
    Deploy the Python event handler to a Compute Engine Spot VM instance group because serverless compute products cannot be triggered directly by Cloud Pub/Sub topics.

Answer

The correct serverless compute design decisions are to deploy the containerized Go microservice to Cloud Run and deploy the Python event handler as a Cloud Function triggered by Cloud Pub/Sub.
Selecting Cloud Run for the Go microservice satisfies the containerization, concurrency (up to 80 requests/instance), and long-running execution (up to 60 minutes) requirements. Selecting Cloud Functions for the Python script provides an optimal serverless, event-driven architecture triggered directly by Pub/Sub messages without needing container build pipelines.

Step-by-Step Solution

1
Analyze the requirements for the containerized Go microservice.
The service requires running a custom container image, handling up to 80 concurrent requests per instance, and supporting an execution timeout of 45 minutes.
Cloud Run allows custom containers, supports concurrency up to 1000 requests per instance, and permits request execution timeouts up to 60 minutes, matching all specified constraints.
2
Analyze the requirements for the lightweight Python event handler.
The service requires a quick, single-purpose code snippet triggered by Cloud Pub/Sub messages.
Cloud Functions is specifically built for lightweight, event-driven code snippets triggered natively by GCP services such as Pub/Sub without container overhead.

Key Concept

Selecting between Cloud Run and Cloud Functions based on concurrency, execution timeout limits, containerization needs, and event triggers.
Rate this question