Question

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

An organization is architecting two backend workloads for an e-commerce platform on Google Cloud:

1. Component 1: A lightweight, event-driven task triggered by file uploads to Cloud Storage that extracts image metadata in under 5 seconds.
2. Component 2: A web-facing invoice rendering service requiring custom Linux dynamic C++ system libraries, WebSocket support, and handling up to 80 concurrent HTTP requests per instance.

Which two deployment strategies represent the optimal serverless compute choices for these components on Google Cloud? (Select TWO.)

  1. Deploy Component 1 to Cloud Functions (2nd gen) using an Eventarc trigger for Cloud Storage events.Answer
  2. Deploy Component 2 to Cloud Run packaged inside a custom container image.Answer
  3. C
    Deploy Component 2 to Cloud Functions (2nd gen) by uploading raw compiled C++ source code.
  4. D
    Deploy Component 1 to a Compute Engine Managed Instance Group (MIG) configured with low CPU threshold autoscaling.

Answer

Deploy Component 1 to Cloud Functions (2nd gen) using an Eventarc trigger for Cloud Storage events, and deploy Component 2 to Cloud Run packaged inside a custom container image.
Cloud Functions (2nd gen) is designed for event-driven snippet execution integrated with Cloud Storage via Eventarc. Cloud Run is designed for containerized applications, supporting custom binaries, dynamic system libraries, WebSockets, and multi-concurrency (up to 250 concurrent requests per instance).

Step-by-Step Solution

1
Analyze Component 1 requirements
Component 1 is short-lived (< 5 seconds) and triggered by Cloud Storage object creation events.
Cloud Functions (2nd gen) seamlessly integrates with Eventarc for Cloud Storage events, making it the most operational-efficient serverless choice.
2
Analyze Component 2 requirements
Component 2 requires a custom C++ runtime with specific OS libraries, WebSocket connections, and high HTTP concurrency (80 requests per container instance).
Cloud Run natively supports custom container images containing any binary/library dependencies, supports WebSockets, and handles concurrent requests per container instance.

Key Concept

Selecting serverless compute options between Cloud Run and Cloud Functions based on execution paradigm, container customizability, event integration, and concurrency requirements.
Rate this question