Why to choose Cloud Run instead of GCP App Engine

Lab Details:

  1. This lab walks you through GCP Cloud Run, its advantages over App Engine.

  2. You will be creating a Hello World function in Python and then containerize your application.

  3. Finally, you will deploy your application to Cloud Run

  4. Region: us-central1

  5. Duration: 45 minutes

What is a GCP Cloud Run?

  • Cloud Run is a GCP service provided which allows you to run your stateless HTTP containers without worrying about the provisioning of machines.

  • In Cloud Run, you begin from a "container image" to a fully managed application which auto-scales with requests using a single command. You only pay when a request is handled.

  • Cloud Run - Managed: By default, It allows 5 minutes timeout, can be configured up to 15 min.

  • Cloud run utilizes stateless applications inside Docker containers. The service can scale up and down automatically and will scale to 0 when not in use whereas the App Engine cannot scale down to 0.

  • In Cloud Run, you are only paying when you are processing requests, and the billing granularity is 0.1 seconds.

  • In Cloud Run, based on "time serving requests" on each instance. If your service handles multiple requests simultaneously, you do not pay for them separately. (This is a cost saver!)

How is it different than App Engine Flexible?

  • App Engine can allow up to 24hours timeout based on the various factors like auto-scaling, manual scaling.

  • In Google App Engine, There is always running at least 1 instance at all times, even if your application is not getting any requests, you will be still paying for that instance.

  • The minimum Billing time is 1 minute.

  • App Engine is always a fully managed service, with auto-scaling features.

  • The drawback is, App Engine Flexible is running on VMs, that's why it is a bit slower than Cloud Run to deploy a new revision of your app and scale-up. Cloud Run deployments are faster as they are not running on VMs.

  • Google App Engine Flexible and Cloud Run have a lot of similarities also. They both accept container images as the deployment input, they both auto-scales, and manage your infrastructure. 

Architecture Diagram:

Lab Tasks:

  1. Login into GCP Console.

  2. Starting Cloud Shell.

  3. Creating a Hello World application.

  4. Containerize and Deploy your application.

  5. Testing the API.

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