Soru

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

An enterprise cloud engineering team is designing a serverless architecture on Google Cloud for two distinct microservices:

1. Microservice A: A web backend that requires long-lived WebSocket connections and needs to process multiple concurrent requests on a single instance to optimize cost efficiency.
2. Microservice B: A lightweight, event-driven Node.js service that processes image metadata whenever a new file is created in a Cloud Storage bucket.

Which TWO deployment options should the team choose to meet these requirements with minimal operational overhead?

  1. Deploy Microservice A to Cloud Run, because Cloud Run supports WebSockets and allows configuring container concurrency to handle multiple requests simultaneously on a single instance.Cevap
  2. Deploy Microservice B to Cloud Functions (2nd gen), because it seamlessly integrates with Cloud Storage Eventarc triggers to execute lightweight code on object creation.Cevap
  3. C
    Deploy Microservice A to Cloud Functions (1st gen), because Cloud Functions is the required GCP serverless runtime for handling persistent WebSocket streams.
  4. D
    Deploy Microservice B to an unmanaged Compute Engine VM instance group configured to continuously poll the Cloud Storage bucket for updates.

Cevap

Deploy Microservice A to Cloud Run to support WebSockets and multi-concurrency per instance, and deploy Microservice B to Cloud Functions (2nd gen) to leverage event-driven Cloud Storage triggers.
Cloud Run is designed for stateless container workloads supporting WebSockets and multi-concurrency (handling multiple simultaneous requests per container instance), making it the optimal choice for Microservice A. Cloud Functions (2nd gen) provides native integration with Cloud Storage event triggers via Eventarc for lightweight event processing, making it the ideal choice for Microservice B.

Adım Adım Çözüm

1
Analyze requirements for Microservice A
Microservice A requires WebSocket support and concurrent request handling per instance.
Cloud Run allows long-lived WebSockets and configurable request concurrency per instance within a containerized environment.
2
Analyze requirements for Microservice B
Microservice B is a lightweight Node.js event handler triggered by Cloud Storage file uploads.
Cloud Functions (2nd gen) natively handles Cloud Storage events via Eventarc triggers with zero server management.
3
Evaluate alternative options against serverless and operational criteria
Compute Engine unmanaged instances introduce server maintenance and inefficient polling.
Fully managed serverless options (Cloud Run and Cloud Functions) are preferred for automatic scaling and zero infrastructure overhead.

Anahtar Kavram

Selecting Cloud Run vs. Cloud Functions based on container concurrency, WebSocket support, and event triggers.
Bu soruyu puanla