Prepare and test your skills

Prepare and test your skills

Deploying BigQuery ML (opens in a new tab) and Vertex AI (opens in a new tab) for scalable analytical inference means running predictions where analytical data already lives instead of moving data to separate Python systems. BigQuery ML models are stored in BigQuery datasets like tables and views and are created with GoogleSQL, the console, the bq command-line tool, the REST API, or notebooks. Vertex AI provides training, registry, deployment, and orchestration services that connect to those datasets for repeatable inference at scale.
In-warehouse inference with BigQuery ML lets analysts train, evaluate, and score data with SQL instead of Python or Java. A model is created with a CREATE MODEL statement with usable defaults, and inference functions then score rows inside BigQuery and write results back to BigQuery tables. This pattern removes extraction, movement, and reformatting of large datasets, which reduces tooling complexity and shortens time to production.
In-warehouse inference depends on co-location of compute and data. The query engine reads from BigQuery storage, applies model logic or calls a connected AI resource, and returns enriched rows in the same query job. For maximum speed, materialized tables are preferred over views or subqueries as training and scoring inputs, and high-throughput reads use the BigQuery Storage API. Feature engineering still matters because cleaner features and tuned model options produce more accurate predictions even when defaults work.
BigQuery ML supports internally trained models for common analytical tasks:
ARIMA_PLUS, and ARIMA_PLUS_XREG forecast and detect anomalies while handling seasonality, holidays, and anomalies.Remote models in BigQuery ML are BigQuery model objects that point to models hosted outside the warehouse. Targets include Vertex AI endpoints, Gemini Enterprise Agent Platform models, and Cloud AI APIs for tasks such as text generation and machine translation. Row data flows from the analytical table to the remote endpoint during query execution, and predictions flow back from the endpoint into the query result set in BigQuery. This lets a SQL user enrich structured data with generative and prebuilt AI without managing serving infrastructure.
Operational control for remote inference spans both systems. The model reference lives in BigQuery and inherits dataset governance and Identity and Access Management controls, while the underlying model lives in Vertex AI Model Registry with versioning, monitoring, and explainability through Vertex AI TensorBoard, Experiments, and Vertex Explainable AI. Structured features can be centralized in Vertex AI Feature Store, which stores feature data in a BigQuery table or view and serves low-latency online lookups while retaining historical offline data in BigQuery. Unstructured inputs are stored in Cloud Storage in large sharded files, governed through BigQuery object tables and signed URLs, with vector embeddings managed in Vector Search indexes.
An ML pipeline is a managed MLOps workflow made of standardized pipeline tasks, where each task does one step such as data preparation, training, evaluation, deployment, or batch inference. Separating work into reusable tasks makes training and large-scale inference automatable, monitorable, and repeatable. Vertex AI Pipelines (opens in a new tab) , GoogleSQL multi-statement queries, and Dataform provide three orchestration options with different units and governance.
| Pipeline option | Primary unit | Choose when |
|---|---|---|
| Vertex AI Pipelines | Directed acyclic graph (DAG) of containerized tasks | The workflow needs portable orchestration with input-output dependencies across BigQuery and Vertex AI |
| GoogleSQL queries | Multi-statement query with shared state | The workflow is less complex and can run as an ordered SQL sequence with IF and WHILE logic |
| Dataform | Version-controlled SQL workflow | The workflow is complex ELT with testing, documentation, and Git-based version control |
In Vertex AI Pipelines, the pipeline is structured as a DAG where outputs of one containerized task route to inputs of the next task, or original pipeline inputs feed a task directly. Teams compose these graphs with BigQuery ML components from the Google Cloud Pipeline Components SDK to train and evaluate models such as demand-forecasting models. In GoogleSQL, procedural language executes multiple statements in sequence with shared state to automate table creation, model training, inference, and monitoring, and saved queries can be scheduled for recurring batch scoring. In Dataform, raw data loaded into BigQuery is transformed into tested, documented tables, which provides a governed path from ingestion to feature tables to inference outputs.
Exam tip: Call ML.GENERATE_TEXT iteratively through SQL loops or a Dataform library when scoring large tables, because iteration isolates retryable quota and limit errors instead of failing the entire batch.
The choice between in-warehouse inference and inline ingestion inference is a trade-off among latency, operational overhead, and cost control. In-warehouse inference with BigQuery keeps scoring inside scheduled queries or pipelines, which simplifies operations because fewer tools move data and analysts reuse business intelligence tools, spreadsheets, and scheduled queries. Inline inference places enrichment on the ingestion path from Pub/Sub, Cloud Storage, databases, or external APIs into BigQuery, using Dataflow for batch and stream processing, Cloud Run functions for event-driven ingestion, and Eventarc for event routing.
Performance behavior differs by where compute runs and how data is served. In-warehouse batch scoring scales with BigQuery slots, benefits from materialized inputs and reservation assignments for machine learning workloads, and must respect quotas on Cloud AI service functions. Inline scoring reduces warehouse query load and delivers lower-latency enrichment for streaming use cases, and Dataflow efficiency can be tuned with GPU use and right-fitting while low-latency features are served from Feature Store online stores backed by BigQuery. Standardization through Knowledge Catalog metadata, BigQuery sharing exchanges and clean rooms, and reusable data products reduces duplicated feature engineering in both patterns.
Cost follows the execution service rather than the model alone. BigQuery pricing (opens in a new tab) includes on-demand pricing where cost is based on bytes scanned with fixed per-project query capacity, and capacity-based pricing where dedicated slots are purchased through reservations. Dataflow, Vertex AI endpoints, and Cloud AI API calls add separate compute and serving charges, so continuous inline inference can cost more to operate than periodic warehouse batch scoring but avoids large periodic scans. Teams control spend with custom quotas and billing alerts for queries, iterative retry logic for quota-limited generative functions, and reuse of datasets and features across models.
Integrating pre-trained AI APIs in stream and batch pipelines means calling an external AI service from inside a Cloud Dataflow (opens in a new tab) processing step to convert unstructured media and text into structured records. Data flows from a source such as Cloud Storage or Pub/Sub into Dataflow, then from Dataflow workers to the external API, and then enriched results flow onward to a sink such as BigQuery. Dataflow handles batch and streaming inputs with the same enrichment logic, while the external API imposes its own throughput and call-rate limits that the pipeline must respect.
A Dataflow enrichment stage treats a pre-trained API as an external system that is neither a source nor a sink. The pipeline reads elements from its sources, calls the API for enrichment, filtering, or business logic within a processing step, and writes enriched output to its sinks. This design supports ML-component integration, where Dataflow performs batch and stream processing from various sources and adds AI-derived fields such as labels, entities, or translations. For event-driven architectures, Dataflow can be combined with Eventarc to trigger ML processing when new data arrives.
Enrichment work often includes the same transformations used for feature preparation, such as feature scaling, encoding categorical variables, and creating new features in batch, streaming, or real time. Dataflow or Dataform can automate those transformations, while labeling adds informative tags to raw data to create structured training data. Because the API call happens inside a parallel processing step, the enrichment stage depends on both Dataflow worker capacity and external API capacity.
External API calls from a pipeline incur per-call overhead that can decrease pipeline performance and efficiency. Each element sent as a separate request pays network and request-handling cost, so batching multiple elements into single requests reduces overhead where the API supports it. Many native Apache Beam I/O transforms perform this batching automatically, including BigQueryIO and streaming insert operations.
Aside from capacity limits, external services enforce quotas that constrain how the pipeline can call them. A quota can limit total calls over a period, such as a daily quota, or restrict call rate, such as requests per second. The pipeline therefore depends on API quota as an upper bound: even if Dataflow can process faster, the API will throttle or reject traffic beyond quota. Pipeline design must track both the daily total and the per-second rate, because exceeding either causes failures or backpressure.
Dataflow parallelism directly multiplies traffic to an external API. Traffic flows from many workers concurrently to the same API endpoint, so too much parallel traffic can overwhelm the service or exhaust its quotas. When autoscaling is enabled, Dataflow may interpret a slow enrichment step as a need for more capacity and add workers to run the slow external call. Adding workers then sends even more concurrent requests, which adds pressure on the external system instead of fixing the bottleneck.
To keep throughput sustainable, the pipeline must either ensure the external system can support the anticipated load or limit traffic to sustainable levels. Practical controls include limiting batch sizes and concurrent calls to external services, so each worker sends fewer, larger requests with bounded parallelism. This trade-off favors slightly higher latency per batch in exchange for stable throughput, fewer quota errors, and less retry load.
Exam tip: Adding Dataflow workers does not speed up a pipeline blocked on an external AI API quota — it increases concurrent calls and can exhaust the requests-per-second quota faster, so throttle and batch instead.
Pipeline scalability is shaped by factors outside pipeline code and the Dataflow service itself. Capacity planning (opens in a new tab) must account for three outside factors that set practical limits on enrichment throughput:
Using Google Cloud managed sources and sinks removes much capacity-management complexity by providing built-in scalability, consistent performance, and quotas that fit most requirements. Pub/Sub provides scalable and durable event ingestion for delivering messages to and from streaming pipelines, with data-throughput quotas applied at the project level for publishers and subscribers. If multiple pipelines publish or subscribe to one topic, deploying each pipeline into its own project gives each pipeline independent throughput quota on that topic. Dataflow jobs run on Compute Engine virtual machine instances, so insufficient Compute Engine quota can prevent jobs from starting or hinder autoscaling during an enrichment surge.
Securing and governing enriched data means removing or masking sensitive information before AI processing and then tracking resulting assets under central governance. In Google Cloud, Sensitive Data Protection (opens in a new tab) handles discovery and de-identification through the Cloud Data Loss Prevention (DLP) API, while Knowledge Catalog in Dataplex provides lineage, quality, and metadata governance for enriched assets across lakes, warehouses, and AI pipelines.
Sensitive Data Protection is the Google Cloud service that discovers, classifies, and de-identifies sensitive data such as personally identifiable information (PII). The Cloud Data Loss Prevention (DLP) API inspects content using infoTypes and infoType detectors, then applies transformations such as pseudonymization, de-identification, and generalization such as bucketing to preserve utility while reducing exposure. For analytics, teams make a de-identified copy that masks or tokenizes sensitive columns so analysts and models work without seeing raw identifiers. Data minimization means not collecting, keeping, or using data that is not strictly necessary, and using synthetic or fully anonymized data where possible.
An inline de-identification pipeline ensures that sensitive data flows from the source to the DLP API for processing and only after that to storage or AI enrichment. The reference flow moves data through an ordered sequence:
This order prevents raw PII from becoming persistent in the destination. De-identifying before sharing, labeling, or training helps meet privacy regulations such as GDPR because only the protected copy reaches downstream enrichment and model training.
Sensitive data discovery is a continuous profiling service that scans at the organization, folder, or project level and generates data profiles with sensitivity and data risk levels. The discovery service acts as a source of truth because it automatically detects, classifies, and reports on new data as projects and uploads grow. Profiles can be analyzed by risk, by infoType, and by location, and can be exported to Security Command Center, Google SecOps, and Knowledge Catalog for monitoring and audit reporting.
| Scenario | Condition | Governance action |
|---|---|---|
| Sensitive data expected and protected | Sensitive data was found where expected with proper access controls | Include profiles in audit reports, publish to monitoring tools, and continue monitoring for change |
| Sensitive data unexpected or unprotected | Sensitive data was found without expected controls or in the wrong workload | Establish access controls or make a de-identified copy, then monitor as in the protected case |
| Sensitive data needs investigation | Findings are unclear and require more context | Investigate lineage, access, and business context before choosing protection or remediation |
Exam tip: Use continuous discovery profiles to find where sensitive data lives, and use inspection plus de-identification jobs to mask, tokenize, or redact specific columns before AI processing.
Knowledge Catalog is the fully managed metadata management service in Dataplex that centrally discovers, manages, monitors, and governs data and AI artifacts. Knowledge Catalog automatically ingests metadata from supported Google Cloud sources into a universal catalog, while custom entries cover sources outside Google Cloud. Technical metadata is enriched with business metadata through aspects and aspect types, and sensitive-data inspection results from BigQuery can be sent to Knowledge Catalog as aspects.
Knowledge Catalog supports strict governance for enriched data through peer capabilities:
To complete governance, teams combine Knowledge Catalog signals (opens in a new tab) with audit and quality signals from Cloud Logging, Cloud Monitoring, Cloud Audit Logs, and anomaly detection in BigQuery. Logs of data access and manipulation support audits, detection of unauthorized access, and protection against issues such as data poisoning that would degrade model reliability.
AI data enrichment connects three decisions into one governed flow. Inference runs either inside BigQuery for scheduled batch scoring or inline in Dataflow and event-driven ingestion for low-latency streaming, remote models extend SQL to Vertex AI endpoints and pre-trained APIs, and Sensitive Data Protection plus Knowledge Catalog ensure that only de-identified data reaches those models and that lineage, quality, and cost remain traceable.
In-warehouse inference in BigQuery keeps scoring inside scheduled queries or pipelines, which simplifies operations and lets analysts reuse business intelligence tools, spreadsheets, and scheduled queries. Inline ingestion inference places enrichment on the ingestion path with Dataflow for batch and stream processing, which reduces warehouse query load and delivers lower-latency enrichment for streaming but adds separate Dataflow, Vertex AI endpoint, and Cloud AI API charges.
Remote models in BigQuery ML are BigQuery model objects that point to models hosted outside the warehouse such as Vertex AI endpoints, Gemini Enterprise Agent Platform models, and Cloud AI APIs. Row data flows from the analytical table to the remote endpoint during query execution and predictions flow back into the query result set in BigQuery, which lets a SQL user enrich structured data with generative and prebuilt AI without managing serving infrastructure.
Adding Cloud Dataflow workers does not speed up a pipeline blocked on an external AI API quota because Dataflow parallelism multiplies concurrent traffic to the same API endpoint. More workers send more concurrent requests, which can overwhelm the service or exhaust its requests-per-second quota faster, so traffic should be limited with batched requests and bounded concurrency in exchange for stable throughput.
An enterprise organization processes continuous streams of unstructured customer support transcripts using an automated data processing pipeline. Before feeding the text into a Vertex AI Foundation Model to generate sentiment analyses and topic summaries, the engineering team must satisfy the following technical and governance requirements:
Which pipeline and governance architecture should the team implement?
Last updated