Source bucket for image uploads
Cloud / Knowledge library
Cloud Run functions
Runs event-driven functions integrated with Google Cloud events and Cloud Run
Why learn Cloud Run functions?
Teams use Cloud Run functions to adopt event-driven functions without building the complete underlying platform themselves.
The problem it solves
Executes short-lived code in response to events without managing servers
Where it came from
Cloud Run functions is Google Cloud's offering for event-driven functions. Its closest catalog counterparts are Azure Functions and AWS Lambda; they address the same broad need but are not feature-for-feature identical.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Explain the main responsibility of Cloud Run functions.
- Choose a workload that fits Cloud Run functions.
- Identify one operational tradeoff of Cloud Run functions.
- Compare Cloud Run functions with Azure Functions.
- Compare Cloud Run functions with AWS Lambda.
Documentation and sources
- Google Cloud products at a glance (docs.cloud.google.com)
Connect the ideas
Alternatives
Real World Example
Automated Image Metadata Extraction for Media Archives
Digital media archives that need to process thousands of incoming image uploads to extract EXIF data for searchable indexing.
The business problem
Manual metadata entry is slow and error-prone, while maintaining a dedicated server for background processing leads to idle costs during low-traffic periods.
How this topic solves it
Cloud Run functions provide an event-driven execution environment that triggers automatically upon file uploads to Cloud Storage, ensuring compute resources are only consumed during active processing.
- Configure a Cloud Storage bucket to act as the event source for image uploads.
- Deploy a Cloud Run function configured to listen for storage.objects.finalize events via Eventarc.
- Implement the function logic to parse image binary data and extract metadata attributes.
- Write the extracted metadata to a managed database for indexing.
Explains the path from file upload to metadata storage.
Event routing layer
Serverless compute logic
Metadata storage
- Cloud Storage → triggers finalize event → Eventarc
- Eventarc → invokes function → Cloud Run Function
- Cloud Run Function → writes metadata → Database
Expected business outcome
The archive achieves near-instantaneous metadata availability for new assets without the operational overhead of managing persistent compute infrastructure.
Limitations and checks
Cold starts can introduce latency for infrequent events; verify performance by monitoring execution duration metrics in the Cloud Console.