What Are Google Cloud Functions?

Google cloud functions

Google Cloud’s event-driven serverless compute platform. GCF is priced according to how long your function runs, how many times it’s invoked, and how many resources you provision for the function

In support of GCF’s “no lock-in” value prop, the Functions Framework lets you write lightweight functions that run in many different environments, including: Cloud Functions, your local development machine, Cloud Run, and Knative-based environments.

Use open source FaaS (function as a service) framework to run functions across multiple environments and prevent lock-in. Supported environments include Cloud Functions, local development environment, on-premises, Cloud Run, Cloud Run for Anthos, and other Knative-based serverless environments.

Cloud Functions event sources include HTTP for web, mobile, or backend applications, Cloud Storage, Cloud Pub/Sub, Cloud Firestore, Firebase (Realtime Database, Storage, Analytics, Auth), and Stackdriver Logging.

Creating a response to an event is done with a trigger. Binding a function to a trigger allows you to capture and act on events.

GCF supports the following trigger types:  HTTP, Cloud Pub/Sub, and other sources like Firebase.

HTTP events trigger HTTP functions, and all other event types trigger background functions.

HTTP Functions pass the ExpressJS parameters (request, response).

Background Functions pass the parameters (data, context, callback).

Google Cloud Functions Runtimes

Google Cloud Functions supports Node.js, Python, and Go, with Java coming soon.

GCF has two main types of functions: HTTP and Background.

Invoke HTTP functions from standard HTTP requests. These HTTP requests wait for the response and support handling of common HTTP request methods like GET, PUT, POST, DELETE and OPTIONS.

Background functions are invoked directly by events from your Cloud infrastructure, such as messages on a Pub/Sub topic, or changes in a Cloud Storage bucket.

Create your first event flow in under 5 minutes