Is my function a good fit for Cloud Run?

Cloud Run removes the work of managing servers, configuring software, updating frameworks, and patching operating systems. The software and infrastructure are fully managed by Google so that you just add code. Furthermore, provisioning of resources happens automatically in response to events. This means that a function automatically scales out from a few invocations a day to many millions of invocations without any work from you.

When you deploy a function with Cloud Run, you receive all of the benefits described in the Container runtime contract.

Use cases

Asynchronous workloads (such as lightweight ETL) or cloud automations (such as triggering application builds) no longer need their own server or a developer to manually manage them. You can directly deploy a function bound to the event you want.

The fine-grained, on-demand nature of Cloud Run functions also makes it a perfect candidate for lightweight APIs and webhooks. In addition, the automatic provisioning of HTTP endpoints when you deploy an HTTP function means there is no complicated configuration required as there is with some other services. See the following table for additional common Cloud Run use cases:

Use case Description
Data processing / ETL Listen and respond to Cloud Storage events such as when a file is created, changed, or removed. Process images, perform video transcoding, validate and transform data, and invoke any service on the internet from Cloud Run.
Webhooks Using an HTTP trigger, respond to events originating from 3rd party systems like GitHub, Slack, Stripe, or from anywhere that can send HTTP requests.
Lightweight APIs Compose applications from lightweight, loosely coupled bits of logic that are quick to build and that scale instantly. Your functions can be event-driven or invoked directly over HTTP/S.
Mobile backend Use Google's mobile platform for app developers, Firebase, and write your mobile backend in Cloud Run functions. Listen and respond to events from Firebase Analytics, Realtime Database, Authentication, and Storage.
IoT Imagine tens or hundreds of thousands of devices streaming data into Pub/Sub, thereby launching Cloud Run functions to process, transform and store data. Cloud Run lets you do it in a way that's completely serverless.
AI/ML Create a scalable image processing service with the Cloud Vision API, or post process output data from a Vertex AI custom-trained model.

Connect and extend cloud services

Cloud Run functions provides a connective layer of logic that lets you write code to connect and extend cloud services. Listen and respond to a file upload to Cloud Storage, a log change, or an incoming message on a Pub/Sub topic. Cloud Run functions augments existing cloud services and lets you address an increasing number of use cases with arbitrary programming logic. Cloud Run functions have access to the Google Service Account credential and are thus seamlessly authenticated with the majority of Google Cloud services, including Cloud Vision, as well as many others. In addition, Cloud Run functions are supported by numerous Cloud Client Libraries, which further simplify these integrations.

What's next