Question

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

A software architecture team is planning a serverless deployment on Google Cloud for a microservice that runs a third-party C++ binary packaged inside a custom Docker container. The service receives incoming HTTP webhooks and must handle multiple concurrent requests per container instance to maximize resource efficiency and reduce operational costs. Which compute platform should the team select?

  1. Cloud Run, because it supports custom container images and permits handling multiple concurrent requests per container instance.Answer
  2. B
    Cloud Functions (1st gen), because it automatically containerizes third-party binaries and distributes concurrent HTTP requests across underlying virtual machines.
  3. C
    Compute Engine with Unmanaged Instance Groups, because serverless offerings on Google Cloud cannot bind to custom container ports or execute custom compiled binaries.
  4. D
    Cloud Functions (2nd gen), because it is the only Google Cloud serverless option that allows deploying multi-container pods with shared local persistent disk storage.

Answer

Cloud Run should be selected because it supports custom container images and permits handling multiple concurrent requests per container instance.
Cloud Run is a fully managed serverless platform that enables running stateless HTTP containers built from any language or binary. Crucially, Cloud Run allows configuring instance concurrency, allowing a single container instance to process multiple requests simultaneously to minimize cold starts and optimize cost.

Step-by-Step Solution

1
Analyze workload requirements
Workload requires running a custom Docker container with a third-party binary and serving multiple concurrent HTTP requests per instance.
Evaluating operational constraints determines which serverless platform matches the execution profile.
2
Compare serverless compute capabilities on Google Cloud
Cloud Run natively supports custom OCI container images and configurable request concurrency per instance (up to 1000 requests per instance). Cloud Functions is designed primarily for code snippets with source-based deployment.
Selecting between Cloud Run and Cloud Functions depends on whether custom containerization and instance concurrency are key architectural constraints.
3
Select the optimal serverless option
Cloud Run satisfies both custom container image support and request concurrency requirements.
Cloud Run provides serverless scaling to zero while efficiently packing concurrent requests into container instances.

Key Concept

Selecting Serverless Compute Platforms (Cloud Run vs. Cloud Functions)
Rate this question