Compute Engine — Virtual Machines
Rent raw virtual servers from Google. Maximum control, but you manage the OS, patches, scaling, and everything else.
Compute Engine provides resizable Linux/Windows VMs running on Google's infrastructure. You choose a machine type (vCPU + memory), a boot image (Ubuntu, Debian, custom), persistent disks (pd-standard, pd-balanced, pd-ssd), and a network ().
Pricing is per-second with sustained-use discounts (automatic) and committed-use discounts (1- or 3-year contracts). /Spot VMs cost up to 80% less but can be reclaimed any time — perfect for batch jobs, useless for serving.
Auto-scaling is done via (MIGs): a template describes the VM, the MIG replicates it across zones, adds/removes instances based on CPU or custom metrics, and integrates with Cloud Load Balancing.
You are responsible for: OS patches, SSH key management (use OS Login + IAM, not manual authorized_keys), firewall rules (via VPC), backups (via snapshots), monitoring agents. No managed runtime.
When to use: stateful workloads (databases outside Cloud SQL), GPU/TPU training, legacy software that needs a full OS, predictable steady load. When to avoid: stateless HTTP apps that scale to zero — Cloud Run is strictly better.
Grounded on https://cloud.google.com/compute/docs/overview
Next up
Cloud Run — Serverless containers
Deploy a container and forget about servers: Cloud Run runs it, scales it to zero when idle, scales up under load, and gives you an HTTPS URL.