Soru

Zorluk: Çok zorPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

A lead software engineer is designing the serverless architecture for a financial transaction verification service. The workload receives real-time gRPC calls, requires handling up to 80 concurrent requests per instance to optimize resource usage, and executes periodic reconciliation routines lasting up to 45 minutes. The application is packaged as a custom Docker container built on an unsupported language runtime. Which Google Cloud serverless compute option should be recommended to satisfy these requirements?

  1. Deploy the application to Cloud Run, because it natively supports custom container images, gRPC requests, multi-request concurrency per instance, and request timeouts up to 60 minutes.Cevap
  2. B
    Deploy the application to Cloud Functions (2nd gen), because functions automatically package non-standard runtimes into containers and handle high-concurrency gRPC streams by default.
  3. C
    Deploy the application to Cloud Functions (1st gen) with CPU always allocated, using Cloud Scheduler to split the 45-minute reconciliation task across multiple HTTP triggers.
  4. D
    Deploy the application to Compute Engine as a serverless instance group with autoscaling disabled to maintain persistent gRPC channels.

Cevap

Deploy the application to Cloud Run, because it natively supports custom container images, gRPC requests, multi-request concurrency per instance, and request timeouts up to 60 minutes.
The choice emphasizing deployment to Cloud Run is correct because Cloud Run allows developers to deploy arbitrary stateless container images, natively supports gRPC protocol connections, allows setting concurrency up to 1000 requests per instance, and supports request timeouts up to 60 minutes, matching all operational constraints.

Adım Adım Çözüm

1
Analyze the workload requirements
Identified key constraints: custom Docker container runtime, gRPC protocol support, high request concurrency (80 requests per instance), 45-minute execution timeout, and serverless deployment.
Choosing the appropriate serverless compute option requires evaluating platform capabilities against execution limits and runtime requirements.
2
Evaluate Cloud Run against constraints
Cloud Run supports arbitrary custom container images, handles gRPC natively, allows configuring up to 1000 concurrent requests per instance, and allows setting request timeouts up to 60 minutes.
Cloud Run is designed specifically for containerized microservices requiring concurrency and extended execution windows.
3
Evaluate Cloud Functions limitations
Cloud Functions (1st gen) caps execution at 9 minutes and handles requests serially. While 2nd gen runs on Cloud Run infrastructure, Cloud Run directly provides full control over container image definitions, concurrency settings, and gRPC endpoints.
Direct deployment to Cloud Run satisfies all container, protocol, concurrency, and timeout constraints cleanly.

Anahtar Kavram

Planning Serverless Compute Options (Cloud Run vs Cloud Functions)
Bu soruyu puanla