↑ ↓ to move, Enter to open, Esc to close

    GCP-PCDBEProfessional Cloud Database Engineer

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search

    Exams / GCP-PCDBE / D1 Deploy scalable and highly available databases in Google Cloud

    D1.1

    Deploy scalable and highly available databases in Google Cloud

    • 2 min read
    • 5 sections
    • 34 questions
    • Free preview
    • Exam domain: Deploy scalable and highly available databases in Google Cloud
    You are reading a free preview. The rest of the GCP-PCDBE course unlocks with an Exam pass or All access.See plans

    Cloud SQL high availability and replicas

    HA with synchronous standby, asynchronous replicas

    Feature Replication Purpose
    HA standby (regional instance) Synchronous, regional persistent disk across two zones Zonal failover, no data loss
    Read replica (same region) Asynchronous Offload reads; put in a third zone
    Cross-region replica Asynchronous (lag = possible loss) Disaster recovery, promote
    • HA needs automated backups and point-in-time recovery (not on read replicas). The standby cannot serve reads.
    • Enable HA in place: gcloud sql instances patch INSTANCE --availability-type REGIONAL. HA can also be enabled on a read replica.
    • Test with gcloud sql instances failover PRIMARY.
    • SQL Server cross-region replicas: check status with the Always On Availability Group dashboard in SSMS.
    • Place primary, standby and read replica in three different zones.

    Maintenance and protection

    • Maintenance window = one hour; a deny maintenance period (up to 90 days) takes precedence. Example: Sundays 12-1 AM, deny Nov 1 - Jan 15.
    • Enterprise Plus edition gives near-zero downtime for planned operations; HA alone does not.
    • Deletion protection stops Terraform (or users) from dropping an instance.
    • CMEK is set at instance creation; key in the same location.

    Choosing and scaling databases

    Workload to database

    • Spanner: ACID, relational, 99.999% multi-region; Autoscaler linear = gradual growth, direct = immediate capacity.
    • Spanner recovery: stale read at a timestamp for partial corruption; backup at timestamp and restore for whole-database.
    • Bigtable: TB-PB, low latency, scale by nodes (IoT/time series).
    • AlloyDB: continuous backup and recovery gives PITR (1-35 days); read pools scale by node count, manually or with autoscaling.
    • Firestore: schedule exports with Cloud Scheduler + Cloud Function; bundles served from a CDN for shared content.

    Bigtable failover

    Multi-cluster routing

    Multi-cluster routing in a custom app profile fails over automatically; single-cluster routing does not.

    Access, monitoring, ops

    Need Use
    Passwordless AlloyDB Language connector with automatic IAM authentication
    Auth Proxy 403 Access Not Configured Enable Cloud SQL Admin API
    VM app to Cloud SQL Service account with Cloud SQL Client
    Read-only Spanner app Dedicated service account, Database Reader role
    Bottleneck diagnosis System Insights (CPU, memory, disk, deadlocks); Query Insights; Cloud Trace for requests
    CPU/memory SMS alerts Cloud Monitoring alerting policy + notification channel
    Fleet provisioning Terraform

    Exam traps

    • Cross-region replication is never synchronous.
    • Deny period maximum 90 days; windows last one hour.
    • HA does not remove maintenance downtime; Enterprise Plus does.
    • Default Bigtable app profile is single-cluster; use a custom multi-cluster profile.
    • Cloud SQL cannot give low-latency writes in several regions; Spanner can.

    Docs

    The rest of this chapter is part of the GCP-PCDBE premium course

    Unlock every chapter, all 197 questions and spaced review with All access or a 90-day exam pass. Every Fundamentals exam stays free, and the first chapter of every exam is open.

    Chapters