Your team is building a photo-sharing app that stores user-uploaded images in a Cloud Storage bucket. Every time an object is successfully written to the bucket, you must run a short Python routine that creates a 200-pixel thumbnail and writes metadata to Firestore. The solution should require no infrastructure management, charge only while code is executing, and be ready for production quickly. Which compute option best meets these requirements?
Create an autoscaled GKE cluster and run the routine as a Kubernetes Deployment using a Cloud Storage notification sidecar.
Deploy the thumbnail code as a Cloud Function triggered by the Cloud Storage object finalize event.
Provision a small, always-on Compute Engine VM that polls the bucket and processes new images as they appear.
Package the code into a container image and deploy it to Cloud Run with a Pub/Sub trigger.
Cloud Functions is designed for lightweight, event-driven tasks. A Cloud Storage "object finalized" event can directly trigger the function, which runs in a fully managed environment, scales to zero when idle, and incurs costs only while the code is executing. Cloud Run would require packaging and maintaining a container image; although it can be event-triggered, it is more complex than necessary for a single small routine. A GKE cluster or a long-running Compute Engine VM both require provisioning, patching, and continuous resource charges even when no images arrive, conflicting with the goal of zero infrastructure management and pay-per-use execution.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of a Cloud Function in GCP?
Open an interactive chat with Bash
How does a 'Cloud Storage object finalized' event work?
Open an interactive chat with Bash
Why is Cloud Run less suitable for this scenario compared to Cloud Functions?
Open an interactive chat with Bash
What are Cloud Functions in GCP?
Open an interactive chat with Bash
What is a Cloud Storage 'object finalized' event?
Open an interactive chat with Bash
Why is Cloud Run not the best option for this use case?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Planning and implementing a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .