Why to choose Cloud Functions over App Engine and Cloud Run?

Lab Details:

  1. This lab walks you through GCP Cloud Functions

  2. We will learn the difference between Cloud Functions, App Engine, and Cloud Run.

  3. You will be creating a Simple Cloud Function listing names of all the VM Instances in the Project.

  4. Region: us-central1

  5. Duration: 45 minutes

Note: Do not refresh the page after you click Start Lab, wait for a few seconds to get the credentials.
In case while login into Google, if it asks for verification, please enter your mobile number and verify with OTP, Don't worry this Google Account will be deleted after the lab.

What is Cloud Function?

  • Cloud Function lets you deploy snippets of code (functions) written in a limited set of programming languages, to natively handle HTTP requests or events from many GCP sources.

  • Cloud Functions lets you establish triggers on a wide variety of events that can come from a variety of Cloud and Firebase products.

  • Cloud Functions are limited in respect to the libraries, languages, and runtimes supported.

How it is different from Cloud Run and App Engine?

  • Cloud Functions server instances handle requests in a serial manner, which is not configurable whereas Cloud Run instances handle requests in a parallel manner, and the level of parallelism is configurable.

  • Cloud Functions allow you to choose from a set of programming languages and runtimes that is not configurable without requiring that you do anything other than deploying your code whereas Cloud Run allows you to choose any kind of backend configuration, but it requires that you supply a docker configuration that creates the runtime environment (which is more work).

  • App Engine is more suitable for applications, which have numerous functionalities inter-related even unrelated with eath other e.g. microservices, while cloud functions are more events based functions and perform some single-purpose action.

  • It is easy to replicate Cloud Functions on Google App Engine, but replicating an App Engine application on Cloud Functions would be complicated.

Architecture Diagram:

Lab Tasks:

  1. Login into GCP Console.

  2. Creating a Cloud Function to list all the VM instances in the Project.

  3. Once you start the lab, 1 VM Instance will be provisioned named whizlabs-cloud-function.

  4. Trigger the function through HTTP Request to print the list of VM instances in the Project.

Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses

Open Console