Question

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

A healthcare analytics platform on Google Cloud is planning the serverless compute architecture for two microservices:

1. Service A: A lightweight Python script triggered by incoming HTTP webhooks from patient monitoring devices, requiring minimal deployment overhead and execution under 5 seconds.
2. Service B: A custom microservice compiled from C++ source code packaged as a Docker container image that must process up to 80 concurrent HTTP requests per instance to optimize compute costs.

Which of the following serverless compute recommendations should the cloud engineer implement? (Select TWO.)

  1. Deploy Service A to Cloud Functions because it provides an event-driven serverless environment optimized for lightweight code snippets without requiring container management.Answer
  2. Deploy Service B to Cloud Run because it supports custom container images and allows configuring request concurrency up to 80 requests per instance.Answer
  3. C
    Deploy Service B to Cloud Functions (1st gen) because Cloud Functions natively compiles and executes arbitrary C++ source code without containerization.
  4. D
    Deploy Service A to Compute Engine Managed Instance Groups (MIGs) to eliminate cold starts for lightweight event-driven webhooks.

Answer

Deploy Service A using Cloud Functions to leverage a lightweight event-driven model, and deploy Service B using Cloud Run to support custom C++ container images with high request concurrency.
Cloud Functions is designed for lightweight, event-driven webhooks without requiring custom container management. Cloud Run is designed for deploying arbitrary container images, accommodating custom language binaries like C++, and supporting high concurrency settings per container instance.

Step-by-Step Solution

1
Evaluate requirements for Service A.
Service A requires executing a simple Python webhook script quickly with minimal operational management.
Cloud Functions is designed specifically for event-driven functions and webhooks without needing container build pipelines.
2
Evaluate requirements for Service B.
Service B relies on a custom compiled C++ binary in a Docker image and high instance concurrency (80 requests per instance).
Cloud Run supports custom container runtimes and multi-concurrency per container instance, making it the appropriate choice for Service B.

Key Concept

Selecting between Cloud Functions for simple event-driven scripts and Cloud Run for containerized services requiring custom runtimes and multi-request concurrency.
Rate this question