Question

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

A financial analytics company is migrating two backend processing workloads to Google Cloud serverless platforms to eliminate server management overhead:

1. Workload 1: A real-time market data streaming microservice packaged as a custom container image that requires persistent WebSocket connections and needs to process up to 80 concurrent client requests per container instance.
2. Workload 2: A lightweight audit logging script that must execute automatically whenever a new transaction report file is uploaded to a Cloud Storage bucket.

Which TWO architectural choices should the cloud engineering team select to satisfy these workload requirements efficiently? (Select TWO answers.)

  1. Deploy Workload 1 to Cloud Run, because it supports custom container images, persistent WebSockets, and configurable request concurrency per instance.Answer
  2. Deploy Workload 2 to Cloud Functions (2nd gen) configured with an Eventarc Cloud Storage trigger to automatically execute code upon file creation.Answer
  3. C
    Deploy Workload 1 to Cloud Functions (1st gen), because it natively supports custom multi-container deployments and high request concurrency per instance.
  4. D
    Deploy Workload 2 to Compute Engine Spot VMs with an unmanaged instance group to poll the Cloud Storage bucket for uploaded reports.

Answer

The correct architectural choices are deploying Workload 1 to Cloud Run (supporting custom containers, WebSockets, and concurrency) and deploying Workload 2 to Cloud Functions 2nd gen (handling event-driven Cloud Storage triggers directly).
Cloud Run is optimal for Workload 1 because it natively runs custom container images, supports persistent connections like WebSockets, and handles multiple concurrent requests per instance. Cloud Functions (2nd gen) is optimal for Workload 2 because it offers direct integration with Cloud Storage bucket events via Eventarc to execute lightweight code snippets serverlessly.

Step-by-Step Solution

1
Analyze the requirements for Workload 1
Identified requirements: custom container image, persistent WebSockets, and multiple concurrent requests per instance.
Cloud Run is built on Knative/containers, supports WebSockets out of the box, and allows configuring concurrency (up to 250 requests per instance), whereas Cloud Functions 1st gen processes one request per instance.
2
Analyze the requirements for Workload 2
Identified requirements: lightweight snippet, event-driven execution on Cloud Storage uploads.
Cloud Functions (2nd gen) integrates directly with Eventarc to handle Cloud Storage events serverlessly without requiring polling or virtual machine management.
3
Evaluate the architectural combinations
Cloud Run for Workload 1 and Cloud Functions (2nd gen) for Workload 2 provide the optimal serverless setup.
This combination minimizes operational overhead while matching the specific execution model and protocol needs of each service.

Key Concept

Selecting serverless compute paradigms: Cloud Run for containerized HTTP/WebSocket microservices requiring concurrency vs Cloud Functions for event-driven snippet execution.
Rate this question