professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
A lifecycle diagram showing a new object entering Cloud Storage Standard tier and being automatically moved by lifecycle management rules through Nearline, Coldline, and Archive tiers as access frequency drops from multiple times per month to less than once per year. Bars below each tier show monthly storage fees decreasing while retrieval costs increase.
Partitioning splits large tables into segments, typically by date, so queries scan only relevant partitions and limit total data scanned. Clustering organizes related records within a partition based on column values, reducing block reads during filters and aggregations to further reduce execution costs.
Ephemeral clusters are optimal for scheduled nightly transformations, single-job pipelines, or test runs because they are created for a single job and deleted upon completion, eliminating idle costs between jobs. Persistent clusters are better for continuous streaming, ad-hoc analysis, or strict sub-minute SLAs despite higher continuous charges for idle resources.
Having sufficient project quota does not guarantee physical resources are available in a specific zone. To secure actual capacity, use zonal Compute Reservations to reserve dedicated VM capacity within a specific zone, or enable auto zone placement in Dataproc to automatically direct cluster creation to zones with available capacity.
Compute autoscaling dynamically adjusts processing capacity to match workload demand, preventing both resource shortages and idle spending. Services like Google Cloud Dataflow, Google Kubernetes Engine (GKE), and Vertex AI endpoints use different autoscaling methods. Dataflow scales worker virtual machines (VMs) based on pipeline CPU load and task queues, GKE scales node counts based on pod scheduling needs, and Vertex AI scales inference replicas based on request traffic.
Costs can be further reduced by matching workloads to appropriate, lower-cost resources. Spot VMs offer significant discounts for interruptible tasks like batch transformations and non-urgent machine learning training. Proactive tools like the Quota Adjuster automate quota increase requests before limits are hit, and the Capacity Planner forecasts future VM, disk, and accelerator needs to prevent over-provisioning.
Storage tiering reduces costs by moving data to progressively cheaper storage classes as it is accessed less frequently. Google Cloud Storage offers four primary classes:
Colder tiers have lower monthly storage fees but higher costs for data retrieval and operations. Object lifecycle management rules automate the movement of data between these tiers based on age or creation date. Network egress costs are also a major factor, as moving data across regions or continents is significantly more expensive than keeping processing within a single region.
BigQuery cost optimization involves managing how queries are billed and minimizing the volume of data scanned. Organizations choose between on-demand billing (pay per terabyte scanned) and capacity-based billing (pay for dedicated compute units called slots). Using batch execution for non-urgent queries and the high-throughput BigQuery Storage API can also lower costs.
Analyzing query execution plans helps identify expensive operations. Applying these structural table optimizations limits scan volume:
Exam tip: In BigQuery, partitioning restricts the total data scanned by filtering on partition keys, while clustering organizes data within those partitions to reduce execution costs.
Provisioning the right compute resources and hardware accelerators ensures critical pipelines meet processing deadlines. Dataflow scales dynamically, but has platform limits: standard jobs support up to 2,000 Compute Engine instances, while Streaming Engine jobs support up to 4,000. For heavy calculations, Dataflow can use graphical processing units (GPUs) or tensor processing units (TPUs), which require Runner v2, custom container images, and a minimum 50 GB boot disk.
For Google Cloud Dataproc, administrators must prevent RESOURCE_EXHAUSTED errors from regional quota exhaustion by enabling auto zone placement. This feature automatically directs cluster creation to zones with available capacity.
BigQuery slot reservations allocate dedicated pools of computational capacity to guarantee that critical jobs never compete with ad-hoc queries. Administrators create reservations in a central administration project and assign them to specific projects, folders, or organizations. This isolates workloads like ELT pipelines, BI reporting, and data science.
Fine-grained isolation relies on Identity and Access Management (IAM) conditions and reservation policies. Administrators use IAM conditions based on reservation names to grant the reservations.use permission. Reservations can be configured to block borrowing idle slots from other pools, ensuring strict isolation. Slot sizing should be evaluated over at least a seven-day window using INFORMATION_SCHEMA.JOBS views, Cloud Monitoring, and the Slot Estimator.
Quotas are regional and project-level limits, but an approved quota does not guarantee physical hardware is available in a specific zone. Critical systems require capacity planning to predict growth and reserve hardware.
Organizations use specific strategies to guarantee availability:
Exam tip: Having sufficient project quota does not guarantee physical compute availability in a specific zone; use zonal reservations or auto zone placement to secure actual capacity.
Choosing between persistent and ephemeral (job-based) Dataproc clusters involves balancing startup latency against the cost of idle infrastructure. Ephemeral clusters are created for a single job and deleted upon completion, while persistent clusters run continuously.
| Cluster Lifecycle Model | Startup Latency | Cost Profile | Optimal Workload Type |
|---|---|---|---|
| Ephemeral (Job-Based) | High (90+ second creation time per run) | Low (no charges between jobs) | Scheduled nightly transformations, single-job pipelines, test runs |
| Persistent (Static) | Low (no provisioning delay) | High (continuous charges for idle resources) | Continuous streaming, ad-hoc analysis, strict sub-minute SLAs |
Persistent clusters use autoscaling based on YARN metrics to control costs. Dataproc also uses secondary workers—provisioned as Spot VMs—to handle burst processing. These workers are stateless and do not store Hadoop Distributed File System (HDFS) data. If Google Cloud reclaims a secondary worker, the master node reschedules its tasks onto primary workers without data loss.
Multi-tenant architectures require isolation to prevent workloads from interfering. Google Cloud offers different patterns:
| Isolation Pattern | Mechanism | Isolation Level | Trade-offs |
|---|---|---|---|
| Instance-Level | Dedicated Cloud Spanner instances per tenant | Physical compute and storage boundary | Strongest security; highest cost |
| Database-Level | Dedicated databases within a shared instance | Logical separation with shared compute | Lower cost; risk of resource contention |
| Node Pool Isolation | Dedicated GKE node pools per workload | Workload separation by node labels | Granular rightsizing; requires pod affinity configs |
In GKE, workload placement policies enforce these boundaries. Setting requiredForScheduling: true in node affinity rules guarantees pods run only on designated node pools. Orchestration tools like Cloud Composer (Apache Airflow) coordinate cross-service pipelines, while Dataproc Workflow Templates manage cluster creation, job execution, and teardown as a single operation.
State externalization decouples compute clusters from data and metadata, allowing clusters to be created and destroyed without data loss. Persistent data files are stored in Cloud Storage buckets instead of local HDFS disks. Table schemas and partition metadata are maintained externally using Google Cloud Dataproc Metastore, a managed Apache Hive metastore.
Ephemeral clusters connect to this shared metastore upon creation, query datasets immediately, and shut down without needing to re-register tables. For disaster recovery, Dataproc Metastore can export its metadata to a Cloud Storage bucket. These backups can be replicated across regions. A new cluster can then connect to the restored metastore instance to resume processing.
Exam tip: Secondary Dataproc workers must not store persistent HDFS data blocks, ensuring that preempted nodes do not cause cluster data loss or job failures.
This section focuses on creating automated, repeatable processes for data workloads. While specific details are not provided in the source summaries, automation is a core principle for maintaining efficient and reliable data pipelines. It involves using infrastructure-as-code, workflow orchestration, and templated job definitions to ensure consistent deployments and executions.
This section involves structuring and prioritizing data workloads according to business needs, such as SLAs, cost constraints, and compliance rules. While specific details are not provided in the source summaries, organizing workloads effectively requires classifying jobs (e.g., critical vs. non-critical), applying appropriate resource management (like slot reservations), and enforcing governance controls (like data residency) to align technical execution with business objectives.
This section covers the ongoing observation and diagnosis of data workloads to ensure they are healthy and performing as expected. While specific details are not provided in the source summaries, effective monitoring involves setting up alerts on key metrics (like job failures or high latency), using tools like Cloud Monitoring and BigQuery's INFORMATION_SCHEMA, and establishing processes to quickly identify and resolve issues that impact data pipelines.
Proactive fault tolerance designs systems to anticipate and isolate failures, keeping them running with partial functionality. Key patterns include graceful degradation (reducing functionality), circuit breakers (stopping retries to failing services), and bulkheads (isolating components). In Google Cloud, managed instance groups with health checks automatically restart failed servers, and internal load balancers maintain client connections during recovery. Databases like Cloud SQL and Spanner offer built-in high-availability configurations with automatic failover.
For Compute Engine VMs, the automaticRestart property enables Google Cloud to restart unresponsive instances, and the onHostMaintenance property set to MIGRATE allows live migration during maintenance. Recovery strategies are defined by two metrics: the Recovery Point Objective (RPO) defines acceptable data loss and dictates backup frequency, while the Recovery Time Objective (RTO) defines acceptable downtime and influences standby configurations (hot, warm, or cold).
Building resilient workflows means designing pipelines to continue processing even if a zone or region fails. The level of protection depends on whether resources are zonal, regional, or multi-regional. For pipelines using Dataflow, Dataproc, or Cloud Composer, submitting jobs to a region (without specifying a zone) allows the service to automatically select a healthy zone. For protection against a regional failure, data should be stored in dual-region or multi-region Cloud Storage buckets. If a region fails, pipelines can be rerun in a different region where the data is replicated.
Optimizing data locality—placing compute near its data—minimizes latency and cost. Running a GKE cluster in the same region as a regional Cloud Storage bucket is a common pattern. For multi-regional architectures required for disaster recovery, performance trade-offs exist. Strategies like using Anywhere Cache or placing database read replicas in application regions can help maintain performance.
Preparing for data corruption involves strategies to detect, prevent, and recover from logical data errors, separate from infrastructure failures. A key distinction is between continuous replication, which provides high availability but propagates corruption, and point-in-time backups (like BigQuery snapshots), which allow rollback to a known good state to recover from human error or logical corruption. Data validation and quality checks should be integrated into pipelines. For long-term preservation, a lifecycle policy should migrate older backups to cost-effective Cloud Storage tiers like Nearline, Coldline, and Archive.
Data replication and failover maintain availability by copying data to a secondary location and switching operations there. Managed services provide built-in capabilities:
The choice of strategy is guided by RPO and RTO requirements. Synchronous replication offers low RPO (near-zero data loss) and low RTO (fast failover). Asynchronous cross-region replication has a higher RPO (some data loss window) but is essential for regional failure protection.