A cloud architecture team is planning the deployment of two distinct serverless components on Google Cloud:
Component 1: A stateless REST API packaged as a custom Docker container image that must handle multiple concurrent HTTP requests per instance to optimize resource efficiency.
Component 2: A lightweight, event-driven Python background script that executes strictly whenever a new file is uploaded to a specific Cloud Storage bucket.
Which two architecture choices correctly align with Google Cloud best practices for these serverless workloads?
- Deploy Component 1 to Cloud Run, because Cloud Run supports custom container images and allows a single instance to handle multiple concurrent requests.Answer
- Deploy Component 2 to Cloud Functions using a Cloud Storage event trigger to execute the Python script upon object creation.Answer
- CDeploy Component 1 to Cloud Functions (1st gen), because custom Docker container images with multi-concurrency require legacy Cloud Functions runtimes.
- DDeploy Component 2 to Compute Engine unmanaged instance groups, because serverless platforms on Google Cloud cannot consume Cloud Storage event triggers directly.
Answer
Deploy Component 1 to Cloud Run because it natively supports custom Docker containers and multi-concurrency, and deploy Component 2 to Cloud Functions using a Cloud Storage trigger for lightweight event-driven execution.
The decision to deploy the containerized REST API to Cloud Run correctly matches Cloud Run's native support for custom container images and concurrent HTTP request processing. The decision to deploy the Python file handler to Cloud Functions correctly utilizes Cloud Functions' native integration with Cloud Storage event triggers.
Step-by-Step Solution
Key Concept
Differentiating between Cloud Run (container-native, HTTP multi-concurrency) and Cloud Functions (event-driven code snippets) when planning serverless architectures.