Google Cloud Live Traffic Visualizer

PRIVATE VPC BOUNDARY Browser Client App GCLB Global Balancer Frontend Cloud Run (FE) [INGRESS LOCKED] Backend Core Rules Engine (BE) AlloyDB Cluster Active Primary (us-central1)
DATABASE TRANSACTION LOGS
0 logs

Subsystem Workflow State Queue (/workflows)

Req ID Employee Sector Dates Requested Days Status Next Step Actions

Primary Databases Inspection Consoles

Tables: employees, accrual_balances, departments, workflows, notifications

Student Laboratory Handouts & Challenges

Welcome to the Time-Off Subsystem Lab! In this scenario, you are tasked with upgrading this baseline application from its single-region isolation into a globally available, fault-tolerant infrastructure pattern. Use these challenges to practice drafting production-ready cloud components.

GCP ARCHITECT Duration: 20 mins

Challenge 1: Scale Reads Locally with AlloyDB Read Pool

The initial AlloyDB deployment starts with a single primary instance inside us-central1 to minimize dev costs. As user traffic scales up across international subsidiaries, upgrade your primary cluster by adding a stateless, high-performance Read Pool instance in the primary region using Terraform. This enables shared-storage local read scaling with zero data copy latency.

resource "google_alloydb_instance" "read_pool" {
  cluster       = google_alloydb_cluster.primary.name
  instance_id   = "hr-vacation-read-pool"
  instance_type = "READ_POOL"

  read_pool_config {
    node_count = 1
  }

  machine_config {
    cpu_count = 2
  }
}
NETWORK DEV Duration: 30 mins

Challenge 2: Multi-Region Load Balancing & Anycast Routing

By default, the application is deployed as a secure single-region service with a Global HTTPS Load Balancer (GCLB) in us-central1. To reduce network latency for European users, upgrade the baseline GCLB configuration by adding a second regional Cloud Run app service in europe-west1, declaring a European Serverless Network Endpoint Group (NEG), and registering it as an active-active backend.

# Add a second regional NEG for European users
resource "google_compute_region_network_endpoint_group" "serverless_neg_europe" {
  name                  = "hr-vacation-neg-europe"
  network_endpoint_type = "SERVERLESS"
  region                = "europe-west1"
  cloud_run {
    service = "hr-vacation-app-europe"
  }
}
DEVOPS ENGINEER Duration: 45 mins

Challenge 3: AlloyDB Disaster Recovery & Regional Failover

AlloyDB utilizes continuous storage-level log streaming to replicate transactions to secondary regional clusters with typical latency under 1 second. In this lab, simulate a catastrophic regional failure of us-central1. Follow the Disaster Recovery Runbook to promote the secondary cluster europe-west1 to standalone primary, then update Cloud DNS records so running backends automatically reroute database queries without code modification or redeployments.

# 1. Promote secondary cluster to primary read-write
gcloud alloydb clusters promote-secondary hr-vacation-cluster-secondary \
    --region=europe-west1

# 2. Update DNS zone endpoints inside VPC
gcloud dns record-sets transaction start --zone=hr-vacation-private-zone
gcloud dns record-sets transaction remove --zone=hr-vacation-private-zone \
    --name="write-db.hr-vacation.internal." --ttl=60 --type=A "[PRIMARY_OLD_IP]"
gcloud dns record-sets transaction add --zone=hr-vacation-private-zone \
    --name="write-db.hr-vacation.internal." --ttl=60 --type=A "[EUROPE_NEW_IP]"
gcloud dns record-sets transaction execute --zone=hr-vacation-private-zone