Soru

Zorluk: OrtaPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

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?

  1. Deploy Component 1 to Cloud Run, because Cloud Run supports custom container images and allows a single instance to handle multiple concurrent requests.Cevap
  2. Deploy Component 2 to Cloud Functions using a Cloud Storage event trigger to execute the Python script upon object creation.Cevap
  3. C
    Deploy Component 1 to Cloud Functions (1st gen), because custom Docker container images with multi-concurrency require legacy Cloud Functions runtimes.
  4. D
    Deploy Component 2 to Compute Engine unmanaged instance groups, because serverless platforms on Google Cloud cannot consume Cloud Storage event triggers directly.

Cevap

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.

Adım Adım Çözüm

1
Analyze requirements for Component 1
Component 1 is a stateless REST API packaged as a custom Docker container requiring multi-concurrency per instance.
Cloud Run is the optimal Google Cloud serverless compute platform for containerized applications that handle concurrent HTTP requests.
2
Analyze requirements for Component 2
Component 2 is a simple Python script triggered by file creation in Cloud Storage.
Cloud Functions is designed for simple, event-driven code execution in response to infrastructure events like Cloud Storage bucket uploads.

Anahtar Kavram

Differentiating between Cloud Run (container-native, HTTP multi-concurrency) and Cloud Functions (event-driven code snippets) when planning serverless architectures.
Bu soruyu puanla