Google Cloud Functions

Google entered the Functions as a Service arena in February 2016 with the alpha launch of Cloud Functions. At time of writing, Cloud Functions is transitioning to general availability, and support is limited to JavaScript functions for a select few types of events. Still, in this early phase of Cloud Functions, the platform offers a tremendous amount of utility for certain classes of problems.

One of the primary use cases for Cloud Functions are as glue to create cross-service integrations between various GCP services, as well as external services such as user-defined web services and external third-party systems. However, teams may choose to develop entire service layers using the functions. When taken to the extreme, this can result in a pure microservice pattern, where each API operation is implemented as a discrete function.

Google Cloud Functions are structured as one or more Node.js modules, where the function to invoke is a named export. A single code base can be used to define multiple Cloud Functions, allowing developers to construct shared libraries and reduce code duplication. Cloud Function definitions may also include an optional package.json file to specify npm dependencies and configuration properties, such as the main file containing the exported function to invoke, index.js by default.