CDL
Deep Dive
Compute Engine, GKE, Cloud Run, Cloud Run functions, and App Engine. When to use each option and the key trade-offs for the CDL exam.
Google Cloud offers compute across a spectrum of control vs. abstraction. More control = more responsibility. More abstraction = more development speed.
Compute Engine (IaaS)
GKE (Containers)
Cloud Run (Serverless containers)
Cloud Run functions (FaaS)
App Engine (PaaS)
VMs (instances) on Google's infrastructure. Full control: operating system, network, storage. Equivalent to AWS EC2 or Azure VMs.
Machine types
General purpose (N2, E2), memory-optimized (M3), compute-optimized (C3), GPU/TPU. Fine-tune vCPUs and RAM as needed.
Persistent Disk
Block storage attached to VMs. Standard HDD, Balanced SSD, or Extreme SSD. Independent of the VM lifecycle.
Managed Instance Groups
A group of identical VMs with auto-scaling, auto-healing, and load balancing. For high availability and scale.
Spot VMs
VMs with up to 91% discount that GCP can revoke with 30s notice. Ideal for fault-tolerant batch workloads.
GKE is fully managed Kubernetes. Google created Kubernetes internally (Borg) and donated it as open source — GKE is its most mature and optimized implementation.
Autopilot mode
Google manages all nodes and the control plane. You pay per pod, not per node. Maximum automation.
Standard mode
You control the nodes (VMs). More flexibility for workloads with special hardware requirements.
Auto-scaling
Horizontal Pod Autoscaler (pods) + Cluster Autoscaler (nodes). Scales automatically based on load.
GCP integration
Integrated with Cloud Load Balancing, Cloud Storage, Artifact Registry, Cloud Monitoring, and IAM.
When to choose GKE
Containerized apps with multiple microservices, you need advanced orchestration (rolling updates, canary deployments, service mesh), or your team already uses Kubernetes on-premises.
Cloud Run runs containers without managing infrastructure. Upload your Docker image, Cloud Run scales from 0 to N instances automatically, and you pay only for requests processed.
Scale-to-zero
If there's no traffic, Cloud Run scales to 0. You pay nothing at rest. Scales in milliseconds when a request arrives.
Any language
If it runs in a container, it runs on Cloud Run: Python, Node.js, Go, Java, Ruby, Rust, .NET...
Cloud Run Jobs
For batch tasks that run to completion (not HTTP). File processing, ETL, ML training.
Pricing
You pay per request + CPU/memory while processing. 2M requests/month free. Very economical for APIs with variable traffic.
Cloud Run functions (FaaS)
Runs individual functions in response to events: HTTP, Pub/Sub, Cloud Storage, Firestore. Fully serverless — zero infrastructure management.
App Engine (PaaS)
Managed platform for web apps and APIs. Upload your code, Google manages the runtime, scaling, and OS patches.
| Service | Use it when | Don't use it when |
|---|---|---|
| Compute Engine | You need full OS control, you have legacy apps that can't be containerized, you require specific hardware (GPUs, TPUs) | You want to forget about patching the OS or managing updates |
| GKE | Containerized microservices, you need advanced orchestration, you already use Kubernetes on-premises | You have few simple apps — the K8s overhead isn't worth it |
| Cloud Run | HTTP APIs and services in containers, variable or unpredictable traffic, you want serverless but with your own image | You need to run long-running processes without HTTP (use Cloud Run Jobs) |
| Cloud Run functions | Simple event-driven logic (max 60 min HTTP / 9 min events), responding to GCP events (Storage, Pub/Sub), quick webhooks | Complex logic with multiple dependencies — better to use Cloud Run |
| App Engine | Migrating legacy web apps to the cloud quickly without containerizing, apps with predictable traffic | New projects — Cloud Run offers more flexibility with fewer limitations |
| Dimension | VMs (Compute Engine) | Containers (GKE/Cloud Run) |
|---|---|---|
| What they include | Full OS + runtime + app. The entire stack is virtualized. | Only the app + dependencies. They share the host OS kernel. |
| Typical size | GB (image includes the entire OS) | MB (only the app and its libraries) |
| Startup time | Minutes (full OS boot) | Seconds or less (no OS boot) |
| Isolation | Virtualized hardware — strong isolation between VMs | Isolated process — share the host kernel |
| Portability | Depends on the hypervisor and the image | High: runs the same on any host with Docker/Kubernetes |
| Resource overhead | High: each VM has its own full OS | Low: they share the kernel, more apps per server |
| When to use | Legacy apps, specific OS, hardware isolation needed | Microservices, fast CI/CD, high app density |
An API (Application Programming Interface) is a contract that defines how two software systems can communicate with each other. APIs let different applications share data and functionality without revealing their internal implementation.
In the digital economy, APIs are business assets: they enable partner ecosystems, open new revenue channels, and accelerate integration between services.
New sales channels
An airline exposes a flights API → Kayak, Google Flights integrate it → more sales without more infrastructure.
Direct monetization
Google Maps API, Stripe, Twilio charge for calls to their APIs. The APIs are the product.
Partner ecosystem
APIs let third parties build on top of your platform. The App Store is an ecosystem of APIs.
Internal integration
Microservices communicate via internal APIs. Teams develop independently and in a decoupled way.
Apigee API Management
Google Cloud's platform for designing, deploying, securing, and scaling APIs. It acts as the managed "front door" to all backend services. Apigee is the market-leading API management solution.
Did you get this topic?
Test what you just learned
A startup is building a REST API that receives unpredictable traffic — high load during the day and almost none at night. They have no infrastructure team and want to deploy Docker containers. Which GCP service is most suitable?
Put what you learned to the test with original CDL exam questions.
Start CDL mock examUnlimited mock exams with the Pro plan
Log in to track your progress.