Google Cloud Architecture Essentials

Compute Engine, GKE, Cloud Run, Cloud Run functions, Cloud SQL, Spanner, BigQuery, Pub/Sub, Cloud Storage, Apigee, IAM, Cloud Monitoring and Vertex AI with selection guidance and a reference architecture.

[!VERSION] Reviewed November 2026. Google renamed Cloud Functions to Cloud Run functions in 2024; some documentation still uses the old name.

Reference architecture: global web application

flowchart TB
  U[Users] --> GLB[Global external Application LB<br/>single anycast IP + Cloud CDN + Cloud Armor]
  GLB --> CR1[Cloud Run: region A]
  GLB --> CR2[Cloud Run: region B]
  GLB --> GCS[(Cloud Storage: static assets)]
  CR1 & CR2 --> SP[(Spanner multi-region)]
  CR1 & CR2 --> MS[(Memorystore)]
  CR1 & CR2 --> PS[[Pub/Sub]]
  PS --> GKE[GKE workers]
  PS --> BQ[(BigQuery via subscription)]
  CR1 & CR2 --> SM[Secret Manager / Cloud KMS]
  APIGEE[Apigee: partner APIs] --> GLB

Compute

Service Use for Notes
Compute Engine VMs, special hardware (GPUs/TPUs), lift-and-shift Managed instance groups; Spot VMs; custom machine types
GKE Kubernetes Autopilot (Google manages nodes, pay per pod) or Standard; strong multi-cluster features
Cloud Run Serverless containers (services and jobs) Scale to zero, concurrency per instance, min instances to avoid cold starts, GPUs available in some regions
Cloud Run functions Event-driven functions Built on Cloud Run; Eventarc triggers

Data

Service Use for Notes
Cloud SQL Managed MySQL, PostgreSQL, SQL Server HA with regional instances; read replicas
AlloyDB High-performance PostgreSQL-compatible Columnar engine for analytics; vector search
Spanner Globally distributed, strongly consistent SQL Up to 99.999% SLA for multi-region configurations; GoogleSQL and PostgreSQL dialects; scales horizontally
Firestore Serverless document DB Mobile/web sync; MongoDB-compatible option
Bigtable Wide-column, very high throughput Time series, IoT, personalization features
BigQuery Serverless data warehouse Separation of storage and compute; BigQuery ML; BI Engine; streaming ingestion
Cloud Storage Objects Storage classes, Autoclass, dual/multi-region buckets

Integration and APIs

  • Pub/Sub: global messaging with push/pull subscriptions, ordering keys, dead-letter topics, exactly-once delivery option for pull, BigQuery and Cloud Storage subscriptions.
  • Eventarc, Workflows, Cloud Tasks, Cloud Scheduler.
  • Apigee: full API management (security, quotas, monetization, analytics, developer portal); API Gateway for simpler serverless APIs.

Networking

Global VPC (one network spanning regions, subnets regional), Shared VPC for centralized network control across projects, Private Service Connect, Cloud NAT, Cloud Interconnect/VPN, global load balancing with anycast IPs.

Security and identity

  • IAM: resource hierarchy (organization → folders → projects → resources) with inherited policies; predefined and custom roles; deny policies; Workload Identity Federation for external workloads (GitHub Actions, AWS) without service account keys; Workload Identity for GKE.
  • Organization Policy Service guardrails, VPC Service Controls perimeters, Cloud KMS/HSM/EKM, Secret Manager, Security Command Center, Cloud Armor.

Observability

Cloud Monitoring (metrics, uptime checks, SLO monitoring, alerting), Cloud Logging (Log Analytics with SQL), Cloud Trace, Cloud Profiler; managed Service for Prometheus.

Vertex AI

Unified ML and generative AI platform: Gemini models and Model Garden (including third-party and open models such as Claude, Llama and Gemma), Vertex AI Studio, Agent Builder and Agent Engine, RAG Engine and Vertex AI Search, Vector Search, pipelines, feature store, model registry, evaluation and monitoring.

[!ARCHITECT] Google Cloud is strongest when analytics (BigQuery), global consistency (Spanner), Kubernetes (GKE) or AI (Vertex, TPUs) are central. Design the resource hierarchy and Shared VPC first: they are hard to change later.

Interview questions and answers

Cloud Run or GKE?

Cloud Run for stateless HTTP/event workloads where scale-to-zero and minimal operations matter. GKE for complex workloads needing stateful sets, custom networking, operators, GPUs/TPUs at scale, or Kubernetes portability.

When would you choose Spanner over Cloud SQL?

When you need horizontal write scaling beyond one primary, multi-region strong consistency, or 99.999% availability, and can accept higher cost and Spanner-specific schema design (avoiding monotonically increasing keys).

What is a common BigQuery cost mistake?

Running SELECT * over large unpartitioned tables. Use partitioning and clustering, select only needed columns, set maximum bytes billed, and consider capacity-based pricing (editions) for predictable workloads.