Cloud Functions
Serverless Applications on Google’s Infrastructure
Cloud computing has made possible fully serverless models of computing where logic can be spun up on-demand in response to events originating from anywhere. Construct applications from bite-sized business logic billed to the nearest 100 milliseconds, only while your code is running. Serve users from zero to planet-scale, all without managing any infrastructure.
Microservices Over Monoliths
Developer agility comes from building systems composed of small, independent units of functionality focused on doing one thing well. Cloud Functions lets you build and deploy services at the level of a single function, not at the level of entire applications, containers, or VMs.
Connect & Extend Cloud Services
Cloud Functions provides a connective layer of logic that lets you write code to connect and extend cloud services. Listen and respond to events such as a file upload to Cloud Storage, an incoming message on a Cloud Pub/Sub topic, a log change in Stackdriver Logging, or a mobile-related event from Firebase. Cloud Functions augments existing cloud services and allows you to address an increasing number of use cases with event-driven code.
Serverless Economics
Cloud Functions are ephemeral, spinning up on-demand and back down in response to events in the environment. Pay only while your function is executing, metered to the nearest 100 milliseconds, and pay nothing after your function finishes.
Mobile Ready
Mobile app developers can use Cloud Functions directly from Firebase, Google Cloud’s mobile platform. Firebase natively emits events to which Cloud Functions can respond, including from Firebase Analytics, Realtime Database, Authentication, and Storage.
Just Add Code
Run in a fully-managed, serverless environment where Google handles infrastructure, operating systems, and runtime environments completely on your behalf. Each Cloud Function runs in its own isolated secure execution context, scales automatically, and has a lifecycle independent from other functions.
Open and Familiar
Cloud Functions are written in JavaScript and execute in a standard Node.js runtime environment. We don’t assume anything proprietary all the way down to the operating system, which means your functions will just work—including native libraries you bring to the platform. Discover a superior, open developer experience that comes from working hand-in-hand with the Node.js Foundation, with our Google colleagues and with the community through the open source V8 engine.
CLOUD FUNCTIONS USE CASES
Mobile Backend
Use Google’s mobile platform for app developers, Firebase, and extend your mobile backend with Cloud Functions. Listen and respond to events from Firebase Analytics, Realtime Database, Authentication, and Storage
APIs & Microservices
Compose applications from lightweight, loosely coupled bits of logic that are quick to build and scale automatically. Your functions can be event-driven or invoked directly over HTTP/S
Data Processing / ETL
Listen and respond to Cloud Storage events such as when a file is created, changed, or removed. Process images, do video transcoding, validate or transform data, and invoke any service on the Internet from your Cloud Function
Webhooks
Via a simple HTTP trigger, respond to events originating from 3rd party systems like GitHub, Slack, Stripe, or from anywhere that can send HTTP/S requests
IoT
Imagine tens or hundreds of thousands of devices streaming data into Cloud Pub/Sub automatically launching Cloud Functions to process, transform and store data. Cloud Functions lets you do this in a way that’s completely serverless
CLOUD FUNCTIONS FEATURES
Cloud Pub/Sub Triggers
Cloud Functions can be triggered by messages on a Cloud Pub/Subtopic, and multiple functions can subscribe to the same topic
Cloud Storage Triggers
You can associate a Cloud Function to mutation events on a Cloud Storage bucket. Every time a file in your bucket is created, deleted or modified, your function will execute
Firebase Triggers
Mobile developers will find first-class integration between Firebase and Cloud Functions. See the events exposed by Firebase here
HTTP/S Invocation
Functions deployed with an HTTP trigger are given a fully qualified domain together with a dynamically generated TLS certificate for secure communication
GitHub/Bitbucket
Using Cloud Source Repositories you can deploy Cloud Functions directly from your GitHub or Bitbucket repository without needing to upload code or manage versions yourself
Logging, Monitoring & Debugging
Logs emitted from your Cloud Functions are automatically written to Stackdriver Logging and performance telemetry is recorded inStackdriver Monitoring. Stackdriver Debugger lets you investigate your code’s behavior in production
Automatic Dependency Resolution
You don't need to package up your entire function along with its dependencies for deployment. Send us your source code and your manifest and we'll do the rest