Serverless on Google Cloud: Cloud Run, Cloud Run Functions, App Engine and Choosing the Right Compute

Google Cloud Platform Architect 55 min min read Updated: Nov 17, 2026 Beginner
Serverless on Google Cloud: Cloud Run, Cloud Run Functions, App Engine and Choosing the Right Compute
Beginner Topic 4 of 4

Serverless Means

  • No servers to manage: Google handles scaling, patching and capacity
  • Scale to zero: no traffic, no cost (for most serverless products)
  • Pay per use: request time or resources used

Cloud Run

  • Runs any container (any language) that listens for HTTP requests, or runs as a job
  • Each service gets an HTTPS URL, automatic scaling and revisions
  • Concurrency: one instance can handle many requests at once (default 80), so it is efficient
  • Settings: CPU and memory, min instances (avoid cold starts), max instances (protect backends), timeouts
bash # Build from source and deploy in one step gcloud run deploy hello --source=. --region=asia-south1 --allow-unauthenticated # Or deploy an existing image gcloud run deploy api --image=asia-south1-docker.pkg.dev/my-proj/apps/api:1.0 --region=asia-south1 \ --min-instances=1 --max-instances=20 --concurrency=80 --service-account=api-sa@my-proj.iam.gserviceaccount.com \ --set-secrets=DB_PASSWORD=db-password:latest --no-allow-unauthenticated
FeatureUse
Revisions and traffic splittingSend 10 percent to a new revision (canary) and roll back instantly
Cloud Run jobsRun to completion (batch, migrations, scheduled with Cloud Scheduler)
AuthenticationMake services private. Callers need roles/run.invoker
VPC accessDirect VPC egress or connector to reach private databases
Domain mapping / load balancerCustom domains, Cloud Armor, CDN
bash gcloud run services update-traffic api --region=asia-south1 --to-revisions=api-00002=10,api-00001=90 gcloud run services logs read api --region=asia-south1 --limit=20

Cloud Run Functions

  • Short pieces of code triggered by events: an HTTP call, a file in Cloud Storage, a Pub/Sub message, a Firestore change
  • Built on Cloud Run, so you also get its scaling and settings
  • Good for glue code, small webhooks and automation
python import functions_framework @functions_framework.cloud_event def on_upload(event): data = event.data print("New file:", data["bucket"], data["name"])
bash gcloud functions deploy on-upload --gen2 --runtime=python312 --region=asia-south1 --source=. --entry-point=on_upload \ --trigger-bucket=my-uploads

App Engine

StandardFlexible
Runs onSandbox with supported runtimesDocker containers on Compute Engine VMs
Scale to zeroYesNo (at least one instance)
Start timeSecondsMinutes
UseWeb apps and APIs in common languagesCustom runtimes or background workers

App Engine is the older PaaS. For new projects, Cloud Run is usually the better choice, but you may meet App Engine in existing systems and exam questions.

Choosing Compute

NeedChoose
Full OS control, lift-and-shift, licensed softwareCompute Engine
Many microservices, Kubernetes ecosystemGKE
Stateless web app or API in a container, no clusterCloud Run
Run code on an event with minimal setupCloud Run functions
Existing App Engine appApp Engine
Batch jobs that run to completionCloud Run jobs or Batch
Run VMs on a physical server for yourselfSole-tenant nodes

Practice

  1. Deploy a hello container to Cloud Run and open its URL
  2. Split traffic 90/10 between two revisions
  3. Deploy a function triggered by a Cloud Storage upload
  4. Make a service private and call it with an identity token
  5. Decide the best compute for five described apps

Conclusion

Cloud Run is the default serverless choice for containers, functions handle events, and App Engine remains for older apps. Pick GKE for Kubernetes needs and Compute Engine for full control.

Quick Summary: serverless; Cloud Run; functions; App Engine; choosing.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators