Prepare and test your skills

Prepare and test your skills

Connecting visualization tools to Google Cloud data means establishing secure, fast, and scalable paths from dashboards to BigQuery (opens in a new tab). Traffic flows from the business intelligence (BI) tool to the BigQuery API, then to in-memory acceleration when data is cached, while uncached stages fall back to standard slots without failing the query. Identity flows from OAuth 2.0 tokens, service accounts, or Application Default Credentials to BigQuery, and federated connections extend queries outward to data that remains in external sources.
BigQuery BI Engine (BI Engine) is a fast, in-memory analysis service that accelerates interactive dashboard queries to sub-second response with high concurrency. BI Engine sits behind the BigQuery API and serves cached columns and partitions from memory, so repeated dashboard queries avoid re-scanning storage. It uses a vectorized runtime that processes batches of data efficiently and dictionary run-length encoding to compress cached data, while preserving authorized views, column-level security, and data masking.
BI Engine reservations are separate memory allocations managed per project and region, sized from 1 to 250 GiB and billed per GiB per hour with a supported BigQuery edition. BI Engine caches only the queried parts of columns and partitions rather than whole tables, and administrators can let BigQuery choose what to cache or designate preferred tables to protect critical dashboards. When memory is full, BI Engine offloads least-recently accessed partitions and columns to make room for new queries.
Data layout directly controls how much memory BI Engine needs. Partitioning by time lets a last-quarter dashboard load only recent partitions, clustering orders rows to improve pruning on large tables, and materialized views pre-join and pre-aggregate data into one flat table. Stale materialized views are recommended for best performance because they avoid recomputation on every refresh.
Exam tip: A join or materialized-view query uses BI Engine only when every table it touches is preferred, including both the view and its base tables.
Secure access from BI tools to BigQuery combines OAuth 2.0 authentication, Identity and Access Management (IAM) authorization, and private network isolation. Google's OAuth 2.0 server issues temporary access tokens with an associated scope, and the tool presents that token when calling the public BigQuery REST API and RPC-based Storage Read API over the internet. Tools with native integration, such as Looker, Looker Studio, and Tableau, use this direct API path, while other tools connect through Magnitude Simba ODBC and JDBC drivers without custom API code.
IAM decides who can run jobs and who can read or modify data. Datasets are child resources of projects, and tables inherit permissions from their dataset, so organization and project roles affect job execution while dataset roles affect data access. Administrators assign predefined, basic, or custom roles to users, groups, and service accounts, where a service account is a non-interactive account used by applications. For least privilege, create functional groups, grant only required roles, minimize basic Owner, Editor, and Viewer roles, and give BigLake connection service accounts storage access while removing direct Cloud Storage access from dashboard users so row-level and column-level policies cannot be bypassed.
Hybrid integration connects tools running outside Google Cloud to BigQuery through public APIs, private paths, or standard drivers. Hosts with external IP addresses reach the BigQuery REST API and Storage API over the internet, Compute Engine virtual machines (VMs) with only internal IPs use Private Google Access enabled subnet-by-subnet in a Virtual Private Cloud (VPC) network, and on-premises hosts use Private Google Access for on-premises hosts over Cloud VPN or Cloud Interconnect with DNS, firewall, and route configuration. Deploying a self-managed BI instance on Compute Engine keeps traffic on Google's backbone to minimize latency, and pushing report filters as WHERE clauses reduces result data returned over the network.
Direct integration through developer tools (opens in a new tab) and client libraries for C#, Go, Java, Node.js, PHP, Python, and Ruby reduces code for native tools. The Java Database Connectivity (JDBC) driver fits Java applications requiring Java Runtime Environment 8.0 or later, while the ODBC driver fits non-Java applications needing standard SQL connectivity. Federated connections (opens in a new tab) let BigQuery query data that stays outside, including Amazon S3, Azure Blob Storage, Cloud SQL, Spanner, AlloyDB for PostgreSQL, and SAP Datasphere, with credentials encrypted and stored in the connection service. VPC Service Controls adds a virtual boundary that restricts API use to selected networks even when IAM would otherwise allow the call.
Continue with this study guide: Connecting to tools
Precalculated fields are aggregates, joins, filters, and derived values computed once upstream so dashboards read ready results instead of recomputing them. Data pipelines perform the heavy work ahead of time, and Looker exposes those results through a unified, governed data model to Explores, dashboards, and embedded analytics. This pattern lowers latency for repeated reporting but creates storage overhead and a freshness dependency tied to the last refresh.
A unified data model is the single governed layer where every chart draws from the same definitions. Data flows from prepared tables containing precalculated fields into the model, and from the model to visualizations and data applications. When users filter or aggregate, Looker applies the governed definitions to the prepared data, so business logic stays consistent across self-service analysis. A change to logic is made once in preparation and exposed once through the model, then flows automatically to every dependent visualization.
Meeting a reporting service-level agreement requires matching refresh cadence to business use under cost optimization (opens in a new tab) tradeoffs. Precalculation shifts work earlier so dashboards scan smaller results and load faster, but visualizations can only reflect data as recent as the last run. Operational dashboards need frequent refreshes to stay current, while monthly reviews can accept longer intervals with lower refresh and storage cost.
BigQuery materialized views are precomputed tables that store query results to reduce latency and scan cost on large datasets. BigQuery precomputes views in the background when base tables change and merges stored rows with deltas at query time, so queries stay consistent without a manual pipeline. If base-table changes might invalidate the cached result, BigQuery reads directly from base tables; if not, it reads existing view data plus only the changes.
Candidate fields are repeated aggregations that dominate input bytes, shuffling between nodes, CPU work, and output bytes. Four patterns show where precalculation pays off:
Only incremental materialized views support smart tuning, where BigQuery automatically reroutes qualifying base-table queries to the view. Non-incremental views support broader SQL syntax but cannot use smart tuning.
| View type | SQL support | Smart tuning reuse |
|---|---|---|
| Incremental materialized view | Limited supported syntax | Supported; qualifying base-table queries reroute to the view |
| Non-incremental materialized view | Broader syntax | Not supported |
For AVG, ARRAY_AGG, and APPROX_COUNT_DISTINCT, BigQuery stores an intermediate sketch in proprietary BYTES format rather than the final value, which affects storage-size calculation. Combining views with partitioning by TIMESTAMP or DATE and clustering on frequently filtered columns further reduces bytes scanned.
Refresh pipelines separate orchestration from processing to keep stored fields matching source systems. Cloud Composer, the managed Airflow service, schedules flows as directed acyclic graphs (DAGs) that trigger processing but do not transform data themselves. Dataflow, which executes Apache Beam batch and streaming pipelines in parallel across auto-provisioned workers, reads from sources such as Cloud Storage and writes directly to BigQuery. The refresh write depends on validation passing, so bad input never overwrites trusted tables.
Scheduled refresh copies tables on a recurrent interval with BigQuery Data Transfer Service or ETL tools and fits analysts who tolerate delay, while streaming refresh with Dataflow templates continuously writes events for near-instant needs. Dataflow provides exactly-once processing by default, with an at-least-once streaming mode for lower cost and latency when duplicates are tolerable.
Validation proves source and target match without moving full tables. The open-source Data Validation Tool (DVT) runs the same count, sum, and average aggregations on both sides and compares summaries, which is required when BigQuery cannot join across regions. Canary flows block downstream writes when checks fail, such as missing values in required fields, mismatched row counts, or mismatched column digests. Monitoring with Cloud Monitoring, administrative resource charts, and Dataflow stage metrics then catches staleness, drift, and bottlenecks that testing missed.
Exam tip: When source and target are in different regions, do not join them directly; compute the same sums, averages, quantiles, or row hashes on each side and compare with a client connected to both.
Continue with this study guide: Precalculating fields
BigQuery features for business intelligence combine in-memory acceleration, precomputation, and result reuse to deliver fast dashboards at controlled cost. BigQuery BI Engine (opens in a new tab) caches frequently used columns and partitions in reserved memory, materialized views store expensive joins and aggregations, and cached results reuse prior answers. Choosing among them depends on freshness needs, query shape, concurrency, and operational complexity.
A BI Engine reservation is memory capacity purchased in gibibytes for one billing project and one region that must match the queried datasets' location. Reservations require a supported BigQuery edition and the BigQuery Resource Admin role to create, and they can be managed in the console, with ALTER BI_CAPACITY SET OPTIONS, or with bq update. Capacity is billed per GiB per hour, and increases above 250 GiB typically take three days to one week in most regions.
To size a reservation from actual workload characteristics, follow this ordered workflow:
TOTAL_LOGICAL_BYTES in INFORMATION_SCHEMA.TABLE_STORAGE.reservation/used_bytes in Cloud Monitoring bigquerybiengine metrics.Preferred tables limit acceleration to a listed set so critical dashboards are not evicted by other traffic, while all other tables use standard slots. Queries to materialized views accelerate only when both the view and its base tables are listed, multi-table queries accelerate only when every table is listed, logical views cannot be listed, and JSON columns, partition-level selection, and console listing of public datasets are not supported.
A BigQuery materialized view physically stores a SQL result on disk and refreshes in the background, while a logical view stores only query text and re-executes every time. Data flows from base tables into the materialized view through background refresh, and dashboard queries then read the small stored result instead of scanning large base tables. Choose materialized views for stable, expensive patterns such as dashboard aggregates and filtered joins, and logical views for abstraction, security, or rapidly changing logic.
Freshness comes from automatic maintenance plus query-time merge. BigQuery adds incremental changes with no user action, and querying the view never triggers a refresh. A single-table view can update incrementally on appends, while a join view updates incrementally only when appends arrive on the left side of the JOIN; UPDATE, MERGE, DELETE, truncation, and partition expiration force fallback to base tables. Smart tuning then reroutes any part of a base-table query that the incremental view can answer, with no application rewrite, while direct queries to the view require BigQuery Data Viewer on both view and base tables.
| Dimension | Logical view | Materialized view |
|---|---|---|
| Data persistence | None, virtual definition only | Physical, stored on disk |
| Execution | Expanded and run on every call | Precomputed with background refresh |
| Data staleness | Never, always current | Controlled via refresh and max_staleness |
Exam tip: Only incremental materialized views support smart tuning, so automatic rerouting happens only for incremental views.
Each acceleration strategy reuses a different layer with different freshness and cost. BI Engine reuses queried columns and partitions in memory for high freshness on supported SQL, materialized views and tables reuse precomputed joins for scheduled staleness, and cached results and extracts reuse exact prior answers or 100 MB static snapshots for the lowest compute on identical repeats. Analysis tools (opens in a new tab) such as Looker, Looker Studio, Tableau, and Power BI connect through the BigQuery API via REST, client libraries, or JDBC and ODBC drivers.
BI Engine divides each plan into subqueries and accelerates leaf stages that scan, filter, compute, aggregate, sort with ORDER BY, or perform supported joins, with the rest falling back to standard slots. It works best for pre-joined data with few joins, specifically leaf-level INNER and LEFT OUTER joins where one large fact table joins up to four dimension tables under 5 million rows each and under 5 GiB if unpartitioned or 1 GiB of referenced partitions if partitioned. Window functions accelerate only when the query scans exactly one unpartitioned table under 5 million rows with no JOIN and scanned size times window operators at or below 300 MiB.
When SQL uses unsupported features such as wildcard or external tables, row-level security, JavaScript or remote functions, BigQuery ML, RECURSIVE, search or vector search, or results over 1 GiB, materialize a workaround table refreshed hourly or daily and point dashboards at it. To measure BI Engine accurately, disable Use cached results so BigQuery result caching does not mask acceleration, and monitor INFORMATION_SCHEMA.BI_CAPACITIES, BI_CAPACITY_CHANGES, and JOBS.bi_engine_statistics.acceleration_mode.
Troubleshooting poor queries means separating data-layout problems from capacity contention and then fixing the dominant cause. BigQuery exposes work through bytes read, bytes shuffled, CPU consumed, bytes written, and slot availability, while Cloud SQL and AlloyDB expose it through indexes, statistics, and maintenance history. Resolution follows the data first: refresh statistics, correct schema and indexing, then re-architect with partitioning or sharding only when tuning is not enough.
Query work signals show whether slowness comes from layout or contention. In BigQuery, high bytes read with selective filters points to missing pruning, while high shuffle points to joins and aggregations moving too much data between stages. Query computation (opens in a new tab) evaluation checks input I/O, communication between nodes to the next stage and per slot, computation CPU, output materialization, capacity and concurrency, and SQL patterns. The execution graph reveals slot contention and shuffle quota issues, while Cloud Monitoring, administrative resource charts, and Gemini Cloud Assist track resource use over time.
In Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL, stale statistics cause misestimated row counts and poor join orders, so diagnosis pairs slow-query logs with execution plans and checks when vacuum analyze, reindex, and index defragmentation last ran. VACUUM reclaims dead tuples and its throughput depends on maintenance_work_mem, while too many read replicas hinder VACUUM and setting INDEX_CLEANUP to OFF can speed cleanup on large indexes. AlloyDB surfaces these signals through System Insights for connections and replication lag, Query Insights for query sources, and audit logs for change history.
| Remediation path | What it scales | Key tradeoff |
|---|---|---|
| Read replicas | Read throughput by offloading primary | Does not fix writes or modeling; too many hinder VACUUM |
| Partitioning and indexing | Selectivity by dividing tables | Reduces bytes read but requires migration |
| Database sharding | Writes and reads across instances | Horizontal scale but hotspots and complexity |
Exam tip: Too many read replicas hinder VACUUM on Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL, so scale reads only to the point where maintenance can still complete.
Efficient SQL in BigQuery follows one principle: queries that do less work perform better. Filtering earlier, projecting only needed columns, and avoiding joins that explode output rows reduce bytes read, shuffled, and written. A JOIN stage that outputs far more rows than it inputs signals a need to filter before the join. Some workloads improve without rewrites because BI Engine caches frequently used data for BI-generated SQL without code changes.
Slots are proprietary capacity units required to execute each query stage, continuously recalculated as queries run. On-demand pricing uses a shared pool defaulting to 2,000 slots per project with unbilled bursting, billed by bytes processed. Capacity-based pricing uses dedicated reservations starting at 100 slots with fixed commitments plus autoscaling slots, with bytes included in the capacity price. Choose capacity-based pricing for predictable monthly spend and highly concurrent reporting and extract, load, transform (ELT) workloads.
Concurrency is controlled by available slots in the project or reservation, and queries needing more slots are queued until resources free. Fair scheduling gives each query enough capacity to progress, but more slots do not always make a single query faster. Larger pools help most for large, complex, or highly concurrent workloads, improved by raising reservations or autoscaling limits.
The BigQuery query plan is the per-execution record of how declarative SQL became distributed work, including bytes read, slot time, and stage breakdown. Data flows from SQL to a graph of execution to query stages to granular steps run by parallel workers, with stages communicating through fast distributed shuffle. Programmatic access flows from the job to jobs.get or INFORMATION_SCHEMA.JOBS, which the open-source BigQuery Visualizer can render. Lower total slot seconds leaves more capacity for other queries in the same project.
Introduction to troubleshooting (opens in a new tab) in Cloud SQL centers on the Query insights dashboard and instance overview page. The ordered investigation is: select a metric such as CPU and a range of 1 hour to 30 days, zoom into the high-load interval on the database load chart, select Investigate performance, then after about two minutes review Issue with start and stop time, Observations such as lock contention, and Hypotheses with actions. Cloud SQL compares queries per second, CPU, memory, and disk I/O against a prior 24-hour baseline, except on Monday when it uses the seventh prior day, and a significant threshold change points to the likely cause.
Continue with this study guide: Troubleshooting poor performing queries
Protecting visualization data combines identity governance, fine-grained access, and de-identification so each user sees only what is allowed. BigQuery resources form a hierarchy of organization, project, dataset, table, column, and view, where tables inherit dataset permissions. IAM roles grant minimum necessary access, authorized views and row-column policies narrow visible data, and Cloud Data Loss Prevention (Cloud DLP) transforms sensitive values before analysis or display.
IAM enforces least privilege by granting grouped permissions as roles to users, groups, or service accounts at a hierarchy level, with child resources inheriting parent policies. Basic Owner, Editor, and Viewer roles are broad project roles, predefined roles target common service patterns, and custom roles define granular permission lists. Strongest security uses predefined or custom roles and dedicated service accounts, such as a pipeline account that reads only one bucket and writes only to its destination.
Authorized views let users query a view without read access to base tables, with access flowing from the user to the view and then from the view to the base tables. Table-level controls grant access to specific tables without granting the whole dataset, and authorized user-defined functions follow the same pattern. Column-level security uses Dataplex policy tags such as 1_Sensitive, 2_Private, and 3_Confidential, where higher access implies lower access and base-table policies apply to all views on that table. Row-level security filters rows per requesting identity, allowing one shared table to serve regional or tenant audiences.
| Approach | Scale and placement | Governance behavior |
|---|---|---|
| Authorized views | Limited to 2500 authorized resources per dataset; shares partitioning and region | Base-table column policies apply automatically; shape can change instantly |
| Subset tables | No dataset or table limit; per-tenant partitioning and region with copy cost | Must re-apply column policies; schema changes are complex |
Conditional controls add attribute, network, and time boundaries through IAM Conditions, principal access boundaries, Privileged Access Manager elevation, Identity-Aware Proxy, and Access Context Manager.
A Cloud DLP de-identification pipeline detects personally identifiable information (PII) with an inspection template and transforms it with a de-identification template before storage. Sensitive Data Protection inspects content using infoTypes such as email, phone, and bank account, then applies masking, tokenization, crypto-based tokenization, surrogate replacement, redaction, or generalization. Production pipelines separate detection from transformation so templates are reusable by name across jobs.
Discovery profiles data at organization, folder, or project level to locate sensitive assets before building pipelines, exporting profiles to Security Command Center (opens in a new tab), Google SecOps, and Knowledge Catalog. Unexpected or unprotected findings are remediated by creating de-identified copies, locking down IAM and perimeters, and monitoring for change. High free-text scores with multiple infoTypes signal unstructured notes needing on-demand inspection.
Storage de-identification scans Cloud Storage files via a DlpJob, transforms matches, and writes sanitized copies to a separate output bucket preserving folder hierarchy while leaving sources unchanged. The output bucket is a trust boundary holding only de-identified content for analysts and training. The streaming Cloud Storage to BigQuery template reads CSV rows via Dataflow, sends batches to the DLP API, and writes de-identified rows to BigQuery, respecting the 524 KB DLP API payload limit and requiring global template paths and an existing dataset.
Dynamic data masking obfuscates BigQuery column values when a query runs, based on the caller's IAM permission on the Dataplex policy tag attached to the column. The stored values remain unchanged, so the same table and dashboard serve privileged users who see full detail and restricted users who see placeholders while schema and row counts stay consistent. This differs from encryption at rest, which protects stored bytes, and from column-level access control, which blocks the query entirely if a denied column is selected.
A Dataplex taxonomy is the governance container that authors tag hierarchies, such as personally identifiable information with child tags for email or account number. The column depends on the tag for protection, the tag depends on IAM grants for enforcement, and the result depends on whether the caller holds permission. Changing grants immediately changes the next query's visibility with no reload, while removing a tag removes protection.
| Control | What restricted identity receives | Choose when |
|---|---|---|
| Column-level access control | No access; query fails if column selected | Attribute must be fully hidden |
| Dynamic data masking | Same column with obfuscated values | Column must stay present but hidden |
| Custom data masking | Same column with user-defined logic | Predefined masking format does not fit |
| Row-level security | Only allowed rows | Restriction depends on row values |
Exam tip: Denying a column blocks the query, while masking returns obfuscated values; both enforce through the Dataplex policy tag and the caller's IAM permission.
Use BigQuery BI Engine (BI Engine) when you need high freshness because it reuses queried columns and partitions in reserved memory for supported SQL with high concurrency. Use materialized views or tables when you can accept scheduled staleness from precomputed joins and aggregations, and use cached results or extracts when you want the lowest compute for identical repeats, including 100 MB static snapshots.
A multi-table query accelerates only when every table it touches is listed as a preferred table, and a materialized-view query accelerates only when both the view and its base tables are listed as preferred tables. Logical views cannot be listed as preferred tables, and any uncached stages fall back to standard slots without failing the query.
Dynamic data masking obfuscates BigQuery column values at query time while stored values remain unchanged, so restricted users still see the same column with obfuscated values and consistent schema and row counts. Column-level access control blocks the query entirely if a denied column is selected. Both enforce through Dataplex policy tags and the caller’s permission from Identity and Access Management (IAM).
Last updated