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?
- 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.Answer
- BDeploy Microservice A to Cloud Functions (1st gen) to support custom concurrency configurations, and deploy Microservice B to Cloud Run.
- CDeploy both Microservice A and Microservice B to Cloud Functions (1st gen) configured with shared memory limits to process concurrent HTTP requests.
- DDeploy Microservice A to Cloud Functions (2nd gen) with container concurrency set to 1, and deploy Microservice B to Compute Engine preemptible virtual machines.
Answer
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.
Step-by-Step Solution
Key Concept
Planning Serverless Compute Options: Cloud Run vs. Cloud Functions Concurrency and Triggers
Estimated Time:2m 0s