Soru

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

A logistics enterprise is planning the serverless architecture for two distinct microservices on Google Cloud:

1. Microservice A: A public order-receiving REST service experiencing bursty, unpredictable traffic. To optimize memory usage and reduce cost, the application must handle up to 80 concurrent HTTP requests per instance within a custom container environment.
2. Microservice B: An event-driven processing script that executes short Python logic whenever a new shipment manifest file is uploaded to a specific Cloud Storage bucket.

Which serverless deployment plan aligns with Google Cloud architectural best practices to meet these requirements?

  1. Deploy Microservice A to Cloud Run to utilize multi-concurrency within container instances, and deploy Microservice B to Cloud Functions (2nd gen) triggered directly by Cloud Storage events.Cevap
  2. B
    Deploy Microservice A to Cloud Functions (1st gen) to support custom concurrency configurations, and deploy Microservice B to Cloud Run.
  3. C
    Deploy both Microservice A and Microservice B to Cloud Functions (1st gen) configured with shared memory limits to process concurrent HTTP requests.
  4. D
    Deploy Microservice A to Cloud Functions (2nd gen) with container concurrency set to 1, and deploy Microservice B to Compute Engine preemptible virtual machines.

Cevap

Deploy Microservice A to Cloud Run to utilize multi-concurrency within container instances, and deploy Microservice B to Cloud Functions (2nd gen) triggered directly by Cloud Storage events.
Cloud Run is designed to host stateless containerized microservices and supports configurable request concurrency (up to 80 concurrent requests per instance in this scenario), allowing multiple requests to share CPU and memory resources. Cloud Functions (2nd gen) offers seamless integration with Eventarc and Cloud Storage event triggers for single-purpose event handlers like processing uploaded manifest files.

Adım Adım Çözüm

1
Analyze Microservice A requirements
Microservice A requires a containerized environment and must process up to 80 concurrent HTTP requests per instance.
Cloud Run natively supports request concurrency (up to 1000 requests per instance) for containerized web microservices, reducing container footprint and total cost.
2
Analyze Microservice B requirements
Microservice B is a lightweight, single-purpose Python script triggered by file uploads in a Cloud Storage bucket.
Cloud Functions (2nd gen) built on Eventarc is designed specifically for lightweight event-driven execution responding to Cloud Storage state changes.
3
Evaluate and combine serverless choices
Cloud Run for Microservice A and Cloud Functions for Microservice B.
This combination leverages the unique strengths of each Google Cloud serverless compute platform while meeting all operational constraints.

Anahtar Kavram

Planning Serverless Compute Options: Cloud Run vs. Cloud Functions Concurrency and Triggers
Tahmini Süre:2m 0s
Bu soruyu puanla