Prepare and test your skills

Prepare and test your skills

Minimizing costs per required business need for data means sizing compute and storage to actual demand and letting capacity expand and contract automatically. Elastic compute comes from Compute Engine, Cloud Run, Dataflow, Managed Service for Apache Spark, and BigQuery, while minimize costs (opens in a new tab) guardrails come from Cloud Storage, Persistent Disk, and Cloud Monitoring with billing alerts. The approach optimize continuously (opens in a new tab) by right-sizing, autoscaling, tiering storage, colocating compute with data, and pairing technical controls with budgets and discounted pricing.
Right-sizing means matching machine shape and container size to observed workload before enabling elasticity. Compute Engine provides machine type recommendations that analyze CPU and memory use and suggest a smaller or better-fitted type, and custom machine types let teams provision CPU cores independently of memory when a workload needs more of one than the other. For container jobs on Cloud Run, charges are based on on-demand CPU, memory, and request count, so teams start with default limits and increase only after observing performance.
Separation of layers reduces both latency and idle cost. The storage layer holds bytes in systems such as Cloud Storage, BigQuery storage, Cloud SQL, Spanner, or Bigtable, while the computation layer loads data from storage, processes it, and writes results back. Keeping the layers on separate platforms in the same zone and region lowers communication latency, outbound transfer cost, and I/O operations, and it avoids paying to keep compute running when only storage is needed. For example, data can remain in Cloud Storage while a Managed Service for Apache Spark cluster runs only for the duration of the batch job.
Autoscaling automatically adds capacity when load rises and removes it when load falls, which handles traffic gracefully while reducing cost during quiet periods. Autoscaling in Compute Engine applies to stateless managed instance groups (MIGs), where the autoscaler creates or deletes virtual machine (VM) instances based on utilization; stateful MIGs cannot be autoscaled because each instance preserves unique state. Cloud Run scales regional services automatically and load-balances traffic across multiple zones in the region, so a zone outage does not lose data or stop jobs, while a region outage pauses jobs until Google resolves it.
The choice of VMs, containers, or serverless controls flexibility versus management cost:
| Hosting option | Configuration flexibility | Management responsibility |
|---|---|---|
| VMs on Compute Engine | High, including custom machine types and simultaneous multithreading (SMT) settings | Team manages VMs, patching, scaling, and availability |
| Containers on Google Kubernetes Engine (GKE) | High, with automated deployment, scaling, and management of containerized apps | Team manages clusters and workloads, platform automates orchestration |
| Serverless on Cloud Run | Lower, deployed to a preconfigured platform with CPU and memory limits | Minimal, platform manages provisioning, load balancing, and scale to demand |
Choose VMs when third-party licensing or operating-system access requires control, such as bringing your own license for Windows Server or disabling SMT to reduce vCPUs per core from 2 to 1. Choose GKE when containerized workloads need orchestration across zones, and choose Cloud Run when the priority is focusing on data logic rather than infrastructure. Spot VMs cost significantly less with the same machine types and performance but Compute Engine can preempt them, so they fit fault-tolerant batch jobs without strict service level objectives, not latency-sensitive pipelines.
Capacity planning turns forecasted demand into a concrete footprint with redundancy and cost estimates. Forecasting starts from number of users and request rate, historical trends and seasonal variations, spikes during special events, and business growth such as expansion to new geographies. Based on that forecast, teams estimate MIG size, VM machine type, and number, type, and size of persistent disks with the Google Cloud Pricing Calculator, then add N+1 redundancy where every component has at least one spare beyond the minimum needed.
Capacity must be validated and protected in order:
Higher availability costs more in redundancy and replication, since 99.9% availability allows about 86 seconds of downtime per day while 99% allows about 864 seconds.
Tiered storage controls cost by placing data in the class that matches retention and access frequency. Cloud Storage offers Standard, Nearline, Coldline, and Archive classes, where Nearline, Coldline, and Archive cost less for infrequently accessed data. Lifecycle policies then automatically transition objects to lower-cost classes or delete them based on age and access patterns, which prevents paying Standard prices for aging outputs, logs, and intermediate files.
Durability and performance choices also change cost. Data in regional buckets is replicated synchronously across zones in the region, while dual-region and multi-region buckets store data redundantly in at least two locations with synchronous metadata writes and asynchronous data replication. Dual-region buckets can use turbo replication for a 15-minute recovery point objective across the region pair. For block storage, zonal Persistent Disk is lowest cost, regional Persistent Disk and Hyperdisk Balanced High Availability synchronously replicate between two zones, and Hyperdisk Balanced allows independent provisioning of input/output operations per second (IOPS) and throughput.
Cost-effective processing matches execution style to data volume, burstiness, and latency needs, and it colocates compute with data in the same region to avoid egress. Storage Intelligence advisor surfaces a Spike in Class A or B operations on Coldline or Archive data finding when cold objects are read frequently, which indicates the data belongs in Standard or Nearline. Object Lifecycle Management deletes noncurrent versions or transitions objects to colder classes, Autoclass moves objects between classes as access changes, and bucket relocation colocates buckets with compute, such as moving a bucket accessed from us-central1 out of us-east1.
Migration and execution patterns trade effort for run cost. Lift-and-shift keeps an existing extract, transform, load platform and changes storage stages to BigQuery, which is fastest when the vendor tool already supports BigQuery. Rewrite to managed services fits deprecated pipelines, and Cloud Data Fusion, built on CDAP, supports rewrite through a graphical directed acyclic graph where sources connect to transformations and sinks and the planner executes the graph as an Apache Spark job. Task farming fans work across MIG VMs where each VM runs third-party software plus an agent that pulls messages from a Pub/Sub topic, so data flows from Cloud Scheduler, Airflow, Cloud Storage triggers, or the Pub/Sub API through Pub/Sub topics to agents on MIG VMs. Dataflow, based on Apache Beam, instead runs ingest, pre-process, distribute-and-compute, and post-analyze stages in one pipeline with data locality and autoscaling, so no external orchestrator coordinates multiple pipelines.
Exam tip: BigQueryIO EXPORT moves data through temporary Cloud Storage and consumes export quotas, while DIRECT_READ reads directly through the BigQuery Storage API over gRPC to avoid export quotas and reduce runtime.
Continuous efficiency detects waste, attributes cost to owners, and rightsizes without breaking performance. Cloud Monitoring collects metrics from Compute Engine, GKE, and Cloud Run functions into prebuilt or custom dashboards for CPU, memory, throughput, latency, and error rates, while Cloud Logging centralizes logs and triggers real-time alerts on anomalies. Active Assist, including Recommender, analyzes history at no additional cost to surface idle VMs, rightsizing opportunities, and underutilized commitments.
Billing data flows from metered usage to Cloud Billing reports and the FinOps hub, and detailed data can be exported to BigQuery where SQL aggregates cost by label, project, service, or time. Labels attach team, cost center, environment, or pipeline name for breakdowns, tags support audits, and Terraform enforces labeling at creation. Budgets track actual versus planned cost, alerting policies notify owners when indicators cross limits, and anomaly detection finds spikes that scheduled reports miss. Predictable work then shifts to committed use discounts (CUDs) for one-year or three-year terms, while Spot VMs provide low price with preemption risk for fault-tolerant batch work.
Continue with this study guide: Minimizing costs per required business need for data
Ensuring enough resources for business-critical data processes means forecasting load, checking quota boundaries, and securing physical capacity before pipelines run. Cloud Monitoring collects utilization and quota metrics for alerts, Cloud Quotas enforces per-project boundaries, and Compute Engine reservations hold zonal capacity. Together they give deterministic performance during normal load and traffic and load (opens in a new tab) peaks across regions (opens in a new tab).
Forecasting load turns expected demand into a concrete resource footprint with redundancy and cost. The forecast starts from historical trends, seasonal variations, spikes during special events, and business growth such as expansion to new geographies. That forecast determines the size of Compute Engine MIGs, VM machine type, and the number, type, and size of Persistent Disk volumes, with cost estimated in the Google Cloud Pricing Calculator.
Resource efficiency is the relationship between application load and consumed CPU and memory. Efficiency is measured with load tests under normal and peak conditions and is retested regularly because efficiency can deteriorate at very high load and change over time. For N+1 redundancy, every component has at least one extra component beyond the minimum needed for forecast load, so loss of one element does not stop processing.
Quotas and system limits are the boundaries that determine whether a pipeline can start and scale. Quotas are per-project limits with default values that can typically be raised, while system limits are fixed values that cannot be changed. When a task tries to consume more than its quota allows, the system blocks access and the task fails.
Quota scope and type determine where the constraint appears:
Cloud Dataflow shows how they combine: each project allows up to 3,000,000 Dataflow requests per minute, up to 25 concurrent jobs by default and up to 125 per organization, and each job can use up to 2,000 Compute Engine instances, or up to 4,000 for Streaming Engine streaming jobs or service-based Shuffle batch jobs with no worker zone specified. Per-user pressure is also bounded, including 15,000 monitoring requests per minute and 60 job creation, template, and update requests per minute each.
Exam tip: A quota can be raised through a quota adjustment, but a system limit cannot be changed; exceeding a quota blocks the task until capacity is freed or the quota is increased.
Monitoring utilization means acting before a shortage stops a pipeline. Teams evaluate average and peak utilization of top workloads, analyze historical trends, project future needs, and run load tests to verify how much load the system can handle while meeting latency targets. Alerts on quota metrics fire when usage approaches limits, which prevents failures from exhausted resource or API rate quotas. Capacity Planner shows historical and forecasted use of VMs, Persistent Disks, and GPUs plus reservations and proximity to quota limits, while the quota adjuster proactively submits adjustments when use approaches its value.
Adjusting quotas before execution formally requests a higher value justified by forecasting and testing. There are three paths: through the Google Cloud console, through a support case, and directly with the account team or Technical Account Manager. The console path is preferred when the increase must be addressed quickly:
Most requests are evaluated by automated systems based on availability and history, so critical batch operations should submit well before peak events.
Securing deterministic capacity means holding assured Compute Engine capacity in a specific zone for a chosen machine type. A reservation covers a specified number of VMs, including memory, vCPUs, and optional GPUs and Local SSD disks, so matching VMs can be created whenever needed. The reservation protects critical batch operations from zone-level stock-outs of high-demand accelerators, can be specific to one project or shared across projects, and GPU reservations can be shared with Vertex AI training or prediction.
| Reservation type | When capacity is secured | Choose when |
|---|---|---|
| On-demand reservation | Provisioned at request time, if capacity is available | The need is immediate and current zonal availability is sufficient |
| Future reservation | Requested in advance for a future period with high assurance | The workload is a peak event or critical batch window that must have deterministic availability |
Consumption control determines which VMs use the held capacity. The Use reservation automatically option lets any matching VM consume the reservation, while the Select specific reservation option restricts consumption to VMs that target the reservation by name. For AI throughput, select regions with GPU and Tensor Processing Unit resources, distribute across zones and regions to tolerate outages, and procure future reservations well in advance.
Dynamic provisioning in Dataflow and Dataproc gives pipelines enough compute when load rises without paying for idle workers. The computation layer loads data from the storage layer, processes it, and saves results, and teams deploy storage and compute on separate platforms in the same zone and region, for example by moving storage from Hadoop Distributed File System to Cloud Storage and using Dataproc for computation. Co-location reduces communication time, outbound transfer cost, and input/output operations between storage and compute.
Ephemeral Dataproc clusters provide job-level elasticity by creating and deleting short-lived clusters sized for individual jobs instead of running one long-lived cluster. This approach uses different configurations per job, scales to individual jobs rather than the peak of all jobs combined, pays only while jobs run, and avoids long-term maintenance. Storage remains in Cloud Storage while compute exists only for job duration.
High availability (HA) generally applies to regional deployments and disaster recovery (DR) applies to multi-region deployments:
| Approach | Scope | Replication | Recovery objective |
|---|---|---|---|
| HA | Zones within a single region, often active-active with no single point of failure | Synchronous replication between zones, provided by default by many managed services | Zero or near-zero recovery time and recovery point objectives |
| DR | Two or more regions, unless using multi-regional services | Typically asynchronous replication with manual or semi-automated failover | Higher recovery time and recovery point objectives |
Aggregate availability falls as more tiers are chained: multiply availabilities, so four tiers at 99.9% yield only 99.6%. Parallel services instead yield 1 minus (1 minus A) times (1 minus B), so two 99% services in parallel reach 99.99% while chained they reach only 98%.
Managing BigQuery reservations means controlling how compute capacity is assigned to analysis jobs. A slot is a virtual compute unit that BigQuery uses to execute SQL queries, and BigQuery determines how many slots each query needs based on data size, complexity, and available capacity. Business-critical workloads use capacity-based billing for dedicated slots, while variable workloads can remain on shared on-demand capacity.
| On-demand | Capacity-based | |
|---|---|---|
| Usage model | Data scanned or processed | Dedicated or autoscaling slots |
| Unit of metering | TiB, minimum 10 MiB per query | Slot-hours, 1-minute minimum by default |
| Capacity range | Up to 2,000 slots per project | 50 slots minimum per reservation, up to regional quota |
| Cost control | Optional project-level or user-level quotas | Slot budget per reservation |
| Discounts | Pay-as-you-go only | Optional monthly or annual commitments |
A reservation is a named pool of capacity-based slots that isolates workloads, such as a prod reservation for production and a test reservation for testing so test jobs do not compete with production. Reservations combine baseline slots for always-available capacity, autoscaling slots that expand above baseline, and slot commitments that cover steady-state use at lower price. Reservation assignments route work from a project, folder, organization, or principal to a specific pool, and BigQuery selects the single most specific assignment where project beats folder beats organization. An assignment needs non-zero baseline, non-zero autoscaling, or available idle slots; otherwise it stays pending and the project runs as on-demand. Capacity is monitored from the Workload management page, with Cloud Monitoring dashboards, the Slot estimator, and INFORMATION_SCHEMA.ASSIGNMENTS_BY_PROJECT, ASSIGNMENTS, and JOBS views to verify routing.
Deciding between persistent or job-based clusters means choosing whether capacity is paid for continuously or only during execution. A persistent cluster stays running to serve repeated work, while a job-based ephemeral cluster moves through provisioning, running, and deleted states for each job. Managed Service for Apache Spark (Dataproc) (opens in a new tab) provides the temporary compute, Cloud Dataflow (opens in a new tab) provides orchestrated serverless execution, Cloud Storage holds persistent files, and Dataproc Metastore holds shared schemas.
Orchestration and resource isolation separates tenants, versions, and compute so one pipeline cannot exhaust or expose another. Project-level isolation launches pipeline jobs in a different project from the project that owns the template registry and storage bucket, which is useful when processing for multiple customers must be isolated. A Flex Template is encapsulated within a Docker image that packages all pipeline dependencies aside from the spec into one artifact managed by Artifact Registry, with pull and push permissions and image tags for versions.
Versioned isolation lets each launch specify a different Docker image version when the pipeline starts. Because the image contains dependencies, an older project can keep its pinned tag while a newer project validates the updated tag, so tenants coexist without forced simultaneous upgrades. Externalized services move heavy work out of worker VMs into a dedicated service:
| Service | Workload type | What is externalized |
|---|---|---|
| Streaming Engine | Streaming pipelines | Streaming execution moves from worker VMs to a dedicated service, improving autoscaling and reducing worker resources |
| Dataflow Shuffle | Batch pipelines | Shuffle operations such as GroupByKey, CoGroupByKey, and Combine move from workers and persistent disks to a dedicated service |
| Flexible resource scheduling (FlexRS) | Delay-tolerant batch | Scheduling moves to delayed backend assignment with preemptible plus regular VMs and Dataflow Shuffle, reducing cost |
The orchestrated lifecycle acquires, uses, and releases resources without a persistent cluster. The request is submitted to a region and routed to an available backend in one zone after quota and permission checks:
JOB_STATE_PENDING after preflight checks and assignment, while FlexRS jobs enter JOB_STATE_QUEUED when assignment is delayed.JOB_STATE_RUNNING until cancelled or drained, while batch jobs stop automatically when complete.Exam tip: JOB_STATE_QUEUED applies to FlexRS jobs with delayed backend assignment, while JOB_STATE_PENDING applies after a backend has been assigned and preflight checks are complete.
Persistent and ephemeral clusters answer the same cost question oppositely. A persistent cluster keeps primary workers, control processes, and local state alive across jobs, so interactive queries, streaming pipelines, and back-to-back batch jobs start without provisioning delay but incur charges during idle periods. A job-based cluster provisions VMs when a job is scheduled and deletes them when finished, so no cost accrues between jobs but each job pays startup overhead from VM provisioning, redistribution of work, and sequential stage initialization.
| Cluster lifecycle | Cost driver | Latency profile | Choose when |
|---|---|---|---|
| Persistent cluster | Idle resource cost during low utilization | Low startup latency and predictable performance | Work is frequent, interactive, or has strict latency objectives |
| Ephemeral cluster | Startup and teardown overhead per job | Higher per-job startup latency but no idle charges | Work is intermittent, batch-oriented, and tolerant to provisioning delay |
Benchmark workloads by frequency, duration, and latency sensitivity before committing. Persistent capacity that carries stable minimum load can be covered by committed-use discounts, while variable peaks remain on ephemeral or autoscaled capacity. Avoid very small jobs on ephemeral clusters because fewer jobs on larger datasets amortize fixed startup cost, and set the initial worker count to avoid redistribution during scale-up.
An autoscaling policy in a persistent cluster dynamically adds workers when load rises and removes them when load falls, so cost follows demand without deleting the cluster. Maximum scaling limits keep spending within budget, and higher utilization targets can lower cost but worsen tail latency, so latency-sensitive pipelines should test per-worker capacity under real load. Separating batch work onto dedicated pools with labels, taints, and tolerations lets the autoscaler delete empty nodes faster, while system processes that cannot restart must run on different pools so they do not block scale-down.
Spot VMs are Compute Engine instances with no availability guarantees that cost up to 91% less than standard VMs, and they function as low-cost secondary capacity for fault-tolerant work. Three constraints govern their use: Pod Disruption Budgets might not be respected, there is no guarantee of graceful shutdown once preemption ignores grace periods, and detection of preemption can take several minutes and delay rescheduling. Because the autoscaler prefers Spot VMs for infrastructure cost, maintain a backup pool without Spot VMs, check Spot availability before provisioning, and combine Spot with standard VMs so progress continues. For savings without preemption risk, E2 VMs offer 31% savings compared to N1 types.
Region selection trades compute price against latency and movement cost. Cost varies per region, so run in the least expensive option where latency does not affect the customer, and run the job in the same region as data stores, messaging systems, and Cloud Storage buckets for staging. For production topologies that span zones, monitor inter-zone egress and colocate dependent processes in the same zone, while non-production ephemeral clusters favor single-zone placement. Enforce boundaries with throughput and latency objectives, small pilot jobs to estimate cost, Cloud Billing exports to BigQuery, Cloud Monitoring alerts, project budgets, quotas, and organization policies that limit locations and products.
State externalization moves data and metadata out of a Dataproc cluster so the cluster can be deleted without losing work. Cloud Storage holds persistent files and Dataproc Metastore holds shared schemas, while Dataproc clusters provide only temporary compute for independent runs. Data flows from ingestion and processing jobs into Cloud Storage buckets, and later clusters read that same data back, so no state depends on local disks.
Cloud Storage as the persistent file system is designed for 11 nines of durability with synchronous replication within a region for regional buckets and asynchronous replication across regions for dual-region or multi-region buckets. Object Lifecycle Management transitions objects to lower-cost classes by age or access, and Autoclass dynamically moves data to the most cost-effective class by usage. Recovery planning must align the pipeline and its source data to the same recovery time objective, because a pipeline cannot meet its end-to-end target if its source recovers more slowly.
Dataproc Metastore as the shared metadata layer is a fully managed, highly available, autohealing, and serverless Apache Hive metastore that stores table definitions, schemas, and locations separately from compute. Multiple independent clusters can attach to the same Metastore service and see consistent tables without rebuilding schema knowledge. The service supports backup, restore, export to an external location, and import of exported metadata, and an export task can run alongside each extract, transform, load job for an external backup. If the metastore and files drift out of sync, the MSCK repair command rebuilds partitions from the file layout in Cloud Storage.
Network and identity boundaries complete isolation for single-job pipelines. By default workers receive public IPs, but secure pipelines pass --usePublicIps=false and enable Private Google Access on the Virtual Private Cloud (VPC) subnet so workers route to Cloud Storage, BigQuery, or Pub/Sub internally. Stronger perimeters place pipelines inside VPC Service Controls (VPC-SC) so data cannot be copied outside even with valid credentials, use Shared VPCs with dedicated subnets and strict firewall rules, and disable Secure Shell. Identity isolation creates a dedicated worker service account with roles/dataflow.worker plus only exact read or write roles on touched resources, while the submitter needs roles/dataflow.admin and roles/iam.serviceAccountUser to act as that account.
Use a persistent cluster when work is frequent, interactive, or has strict latency objectives because it keeps primary workers and state alive for low startup latency but incurs idle charges during low utilization. Use an ephemeral job-based cluster when work is intermittent, batch-oriented, and tolerant to provisioning delay because it provisions virtual machines when scheduled and deletes them when finished so no cost accrues between jobs but each job pays startup overhead.
Quotas are per-project limits with default values that can typically be raised through a quota adjustment, while system limits are fixed values that cannot be changed. When a task tries to consume more than its quota allows, the system blocks access and the task fails until capacity is freed or the quota is increased.
Spot VMs fit fault-tolerant batch jobs without strict service level objectives because they offer the same machine types and performance at significantly less cost but Compute Engine can preempt them to reclaim capacity. They should not be used for latency-sensitive pipelines that cannot tolerate preemption.
Last updated