A digital publishing company is architecting serverless compute solutions for two new services on Google Cloud:
1. Service 1: An interactive web API that requires handling up to 250 concurrent HTTP requests per container instance to optimize resource utilization.
2. Service 2: A lightweight background script that executes automatically whenever a raw text file is uploaded to a Cloud Storage bucket.
Which TWO deployment decisions correctly align with Google Cloud serverless compute capabilities for these services?
- Deploy Service 1 to Cloud Run because Cloud Run natively supports receiving multiple concurrent requests on a single container instance.Answer
- BDeploy Service 1 to Cloud Functions (1st gen) because 1st gen Cloud Functions support up to 1,000 concurrent requests per instance by default.
- Deploy Service 2 to Cloud Functions because it directly integrates with Cloud Storage event triggers for automatic execution upon file upload.Answer
- DDeploy Service 2 to Compute Engine virtual machines because serverless products cannot respond to Cloud Storage object creation events.
Answer
Deploying Service 1 to Cloud Run to leverage container instance concurrency, and deploying Service 2 to Cloud Functions to take advantage of native Cloud Storage event triggers.
Cloud Run is ideal for stateless HTTP workloads requiring multi-concurrency per container instance. Cloud Functions is ideal for event-driven background processing triggered directly by Google Cloud services such as Cloud Storage object mutations.
Step-by-Step Solution
Key Concept
Selecting between Cloud Run and Cloud Functions based on concurrency and event-driven trigger requirements