A developer needs to run a small Python script that automatically resizes images whenever a user uploads a new image file to a Google Cloud Storage bucket. The solution must be serverless, event-driven, and execute code directly in response to cloud storage events without requiring the developer to build container images or manage cluster infrastructure. Which Google Cloud compute service should you recommend?
- Cloud FunctionsAnswer
- BCloud Run
- CCompute Engine Spot VMs
- DGoogle Kubernetes Engine (GKE) Standard
Answer
Cloud Functions is the recommended compute solution because it provides a fully managed, serverless, event-driven execution environment for single-purpose code snippets triggered directly by Cloud Storage events.
Cloud Functions is designed specifically for event-driven, serverless execution of lightweight code triggered by Google Cloud services like Cloud Storage. It automatically scales and removes all server and container management overhead.
Step-by-Step Solution
Key Concept
Selecting serverless event-driven compute services for Cloud Storage event triggers