Learn How to Use Handy Cloud Functions in Python with a Practical Example

Let’s simplify our application with modern serverless services

Lynn G. Kwong
8 min readJul 25, 2021
Photo by Pankaj Patel on Unsplash.

Cloud functions in the Google Cloud Platform (GCP) is a serverless function as a service (FaaS) framework. Cloud functions can automatically run backend code in response to events triggered by HTTP requests or events emitted from your cloud infrastructure and services. Cloud functions have the following benefits:

  • Serverless — no need to manage the underlying infrastructure and runtime for the functions, everything is handled by the cloud platform.
  • Automatic — the service is automatically scaled based on the usage, with integrated monitoring, logging, and debugging capability.
  • Cost friendly — you only pay when the function is used, not when it’s idle.

There are two types of cloud functions in GCP, namely HTTP functions and event-driven functions. The latter can be further divided into background functions and cloud event functions depending on the runtime (programming language) they are written in.

In this article, we will introduce HTTP functions and background event-driven functions and demonstrate a simple but useful use case for them. We will first set up an HTTP function to send messages…

--

--

Lynn G. Kwong

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.