Prepare and test your skills

Prepare and test your skills

Optimizing BigQuery (opens in a new tab) schema and storage for analytical workloads means shaping tables, partitions, and compute capacity so complex queries scan less data and use fewer slots. BigQuery separates storage and compute so each scales independently based on demand. When a query runs, the query engine distributes work in parallel across multiple workers, the workers scan the relevant tables in storage, process the query completely in memory, and gather results over a petabit network.
Columnar storage and table types in BigQuery define how analytic data is physically stored and billed. BigQuery storage uses an efficient columnar encoding format called Capacitor that is optimized for analytic workloads. Storage is fully managed, so capacity is allocated when data is loaded and released when data is removed, with compute and storage billed separately and no provisioning required before use. All data is automatically encrypted before it is written to disk, and the service is designed for 99.999999999% annual durability by replicating data across multiple availability zones.
Table data stored in BigQuery storage includes several resource types with different storage behavior:
Cached query results are also stored as temporary tables. Because storage and query resources are allocated dynamically by usage pattern, historical query patterns should guide whether data lives in standard tables, clones for writable testing, snapshots for restore, or materialized views for repeated reads.
Partitioned tables in BigQuery divide a large table so queries with predicate filters on the partitioning column scan less data. Partition pruning directly reduces bytes processed, which lowers cost on on-demand pricing and reduces slot consumption on capacity-based pricing. Partition choice should follow historical query patterns, so the column most often used in date or integer filters becomes the partition key. BigQuery does not support hierarchical partitioning, and it does not support EXCHANGE PARTITION, SPLIT PARTITION, or converting a nonpartitioned table to a partitioned one.
BigQuery implements three types of table partitioning:
TIMESTAMP or DATE column.If partitioning limits and quotas affect the design, consider using sharding instead of partitioning. The tradeoff is management effort against pruning benefit: well-chosen partitions cut bytes and slots for filtered queries, while poorly chosen partitions add complexity without reducing scans.
Exam tip: Use partitioning for DATE, TIMESTAMP, or integer filter columns; use clustering instead when the frequent filter is a string column.
Clustered organization in BigQuery efficiently organizes and retrieves data by storing rows ordered on disk based on columns that are often accessed together. Clustering helps data retrieval when clustered columns are used as filter or aggregation predicates, and it is the recommended replacement for explicit indexes. BigQuery stores data in columnar format, so no indexes are needed or offered for batch analytics.
Choose clustering when a table is commonly filtered and aggregated with specific columns, especially for string columns and for equivalents of list-partitioned tables from other warehouses. BigQuery only supports partitioning by dates and integers, so for strings use clustering instead. BigQuery also supports Search Indexes and Vector Indexes for specialized lookup patterns, and unenforced foreign keys in GoogleSQL primarily help with query optimization. When the workload needs single, small row-based access, Bigtable can be a better alternative, while transaction processing with strong relational consistency belongs in Spanner or Cloud SQL.
Precomputed results with materialized views in BigQuery are designed to improve report rendering time for write-once, read-many reports and workloads. BigQuery leverages the precomputed results from materialized views and, whenever possible, reads only delta changes from the base table to compute up-to-date results. This delta-read behavior keeps repeated dashboard and aggregation queries fast without recomputing the full base table scan, which saves both time and slots.
BigQuery provides Smart Tuning materialized views that always return current data and provide automatic query rewrite to the materialized view even when the query refers to the base table. This differs from standard views in BigQuery, which allow custom views but do not support data manipulation language (DML) statements. Caching in Looker Studio or other modern business intelligence tools can further improve performance by eliminating the need to rerun the same query.
Slot capacity, monitoring, and BI Engine acceleration control how query compute is obtained, sized, and sped up for dashboards. Slots in BigQuery are the units of query compute capacity, and each query uses slots allocated according to query type and complexity. BigQuery uses an eventual fairness scheduler, so some queries may briefly receive a higher share of slots before the scheduler corrects the balance. In traditional terms, BigQuery provides per-second billing and per-second scaling by keeping vast multitenant resources deployed, instantly allocating large chunks for seconds at a time, and charging only for the jobs run.
Two pricing models control how slots are obtained:
| Pricing model | How capacity is obtained | Choose when |
|---|---|---|
| On-demand pricing | Charges for bytes processed by each query | Query volume is variable and partition pruning controls cost |
| Capacity-based pricing | Purchases slot reservations with a minimum of 100 slots, through yearly or three-year commitments | Enterprise reporting and extract-load-transform (ELT) workloads need predictable capacity |
By default, Google Cloud projects are limited to a maximum of 2,000 slots. For example, an organization might reserve 4,000 slots to run 100 medium-complexity queries simultaneously, then add slots if execution plans show high wait times and dashboards show high slot utilization. Historical query patterns guide reservation sizing and physical design decisions through Cloud Monitoring for utilization trends, audit logs analyzed in BigQuery and visualized in Looker Studio, Looker, or Tableau, INFORMATION_SCHEMA.JOBS which maintains history of all jobs submitted in the last 6 months, and BigQuery system tables data for slot utilization across jobs and reservations. BigQuery BI Engine accelerates business intelligence workloads by running fast, in-memory analysis backed by BI reservations, integrates with Looker Studio, Looker, Google Sheets, and third-party tools such as Tableau and Power BI, and allows the size of an existing BI reservation to be updated as dashboard concurrency grows.
Designing secure, multi-tenant data access and sharing architectures means letting separate teams or organization units produce and consume shared data without seeing each other's restricted data or moving data outside approved boundaries. The design combines an identity layer that decides who can access what, a perimeter layer that decides where data can move, and a sharing topology that moves data from producers to consumers through governed storage. In Google Cloud, Identity and Access Management (IAM), Virtual Private Cloud (VPC) Service Controls, and shared services such as Cloud Storage and Pub/Sub form those three layers.
Identity controls and perimeter trust boundaries decide which identities can act and where their requests can travel. Cloud Storage supports two systems for bucket and object access: Identity and Access Management (IAM) and access control lists (ACLs), and IAM at the bucket and project levels is recommended in most cases. For databases, Cloud SQL IAM database authentication provides centralized control by adding IAM users as database users on the instance, so logins use the same IAM identity that governs cloud resources. Organizational policy constraints combined with IAM policies can enable or disable services for sets of users, which prevents storing data in the wrong Google Cloud region.
Trust boundaries around those identities are enforced by VPC Service Controls, which create service perimeters at the project or VPC network level. Traffic from a trusted workload inside the perimeter can reach Cloud Storage, BigQuery, and other Google APIs, while requests from outside the perimeter are denied even when the caller has an IAM permission. Perimeters can be extended to a hybrid environment over an authorized VPN or Cloud Interconnect, and they can restrict Cloud SQL import and export through the Cloud SQL Admin API or Cloud Storage API so data stays within selected network locations. To control Google support access, Access Approval requires explicit customer approval before Google personnel access data or configurations.
Encryption ownership and sensitive-data protection define who controls decryption and how sensitive fields are cleaned before sharing. Encryption for shared data starts with automatic Google-owned and Google-managed encryption for content at rest and in transit, with no customer action required. Pub/Sub encrypts messages by default at the application layer and supports customer-managed encryption keys (CMEK) for additional control over message encryption. Cloud SQL also supports CMEK for data at rest, where Cloud SQL uses the customer key on every API call that accesses data.
Key ownership and location define who controls decryption and where keys reside. Cloud Key Management Service (Cloud KMS) stores keys in the location set at creation, Cloud HSM stores keys inside a physical hardware security module in a chosen region, and Cloud External Key Manager (Cloud EKM) stores and manages keys in a third-party product outside Google infrastructure. Data loaded through Cloud Storage that might include sensitive fields can be discovered, classified, and de-identified with Sensitive Data Protection before it is shared with other tenants.
Governed handover from producers to consumers is the sharing topology that connects a private computing environment to projects in Google Cloud through intermediate storage. Data flows from workloads in the private environment to shared Cloud Storage buckets or Pub/Sub queues, then from those buckets or queues to data processing, analytics, and frontend workloads deployed in an application VPC. IAM policies on the buckets and topics restrict access to trusted workloads, while VPC Service Controls around the Google Cloud projects minimize data exfiltration risk.
The handover flow moves through an ordered sequence:
Connectivity between the private environment and Google Cloud depends on volume, duration, and compliance needs. Communication with Cloud Storage or Pub/Sub can travel over public networks or over private connectivity using VPN, Cloud Interconnect, or Cross-Cloud Interconnect. A gated-ingress variation uses Private Service Connect endpoints for Google APIs inside the VPC, which provides private IP addressing to Cloud Storage, BigQuery, and other APIs over the hybrid connection and avoids high-volume movement over the public internet.
Storage locations and residency tradeoffs determine where shared data is stored, how it is replicated, and which access pattern it supports. Region selection balances availability of Google Cloud services and Compute Engine (opens in a new tab) machine types, end-user latency, resource cost and cross-regional transfer cost, regulatory requirements, and sustainability requirements such as low-carbon regions. The most cost-efficient region might not have the lowest carbon footprint or the lowest latency, so the choice involves explicit tradeoffs.
Storage replication behavior differs by location type:
| Location type | Replication behavior | Choose when |
|---|---|---|
| Cloud Storage regional bucket | Data replicated synchronously across zones in the region | Low-latency access within one region with zone resilience is needed |
| Cloud Storage dual-region bucket | Metadata written synchronously across regions, data replicated asynchronously; turbo replication provides 15-minute recovery point objective across the pair | Higher availability across two geographic locations is needed |
| Cloud Storage multi-region bucket | Data stored redundantly in at least two geographic locations with asynchronous replication | Broad geographic availability for shared reads is needed |
The same residency logic applies to messaging and databases. Pub/Sub message storage policies restrict where message data is stored to meet residency requirements. For Cloud SQL, a cross-region read replica copies the primary in near real time, and promoting the replica to primary after a failure keeps residency standards met only when the replica region complies with regulations. Filestore regional instances replicate synchronously across three zones in a region for shared files mounted on multiple VMs, while regional Persistent Disk volumes replicate synchronously across two zones and Hyperdisk Balanced allows separate, dynamic provisioning of IOPS and throughput for tuned workloads.
Exam tip: High availability uses synchronous replication between zones within a single region with zero or near-zero recovery time objective and recovery point objective, while disaster recovery across regions typically uses asynchronous replication with higher recovery objectives and failover steps.
Shared compute boundaries and reliability math separate configuration flexibility from management effort and show how chained tiers affect availability. Compute Engine virtual machines and Google Kubernetes Engine (GKE) containers provide more configuration flexibility, but the team manages the resources. Cloud Run serverless containers run on a preconfigured platform with minimal management, where Cloud Run jobs run regionally across zones, survive zone outages, and use task retries and checkpointing to handle individual job or task failures.
Reliability for multi-tenant sharing depends on eliminating single points of failure and understanding aggregate availability. Managed instance groups automatically recreate failed VMs, load balancing distributes traffic evenly, high-availability database configurations span zones, and regional persistent disks use synchronous replication. Aggregate availability falls as tiers are chained, calculated as tier1 availability x tier2 availability x tierN availability, while parallelized services run independently with higher combined availability. For cross-region active-active needs, managed multi-regional services such as Spanner and Cloud Storage provide built-in redundancy and synchronization without manual replication steps.
Structuring storage engines for operational and real-time access patterns means matching frequent read-write activity, low-latency needs, and consistency needs to the right Google Cloud storage format. Operational workloads emphasize transactional data, high input/output operations per second (IOPS), simultaneous clients, and predictable throughput, while real-time workloads add low-latency caching, scratch space, and fast failover. Google Cloud divides the options into block storage for Compute Engine workloads, managed databases such as Cloud Bigtable (opens in a new tab) and Cloud Spanner, and Cloud Storage for object-based access.
Operational requirements and read-write profiles define how data is written, read, shared, and protected during normal processing. The design process starts with functional characteristics, security constraints, resilience needs, performance expectations, and cost goals, and the process can iterate when a storage feature changes application behavior. Key questions include required I/O rate, read and write throughput, whether capacity must scale automatically, whether multiple clients read or write simultaneously, whether low-latency caching or scratch space is needed, and whether replicated datasets need strict read-write consistency.
Expected read-write patterns shape the engine choice:
Granular definitions, future growth, and cloud-specific opportunities also matter. A workload may need a specific file protocol version, expansion to new regions with residency rules, replication across two Google Cloud locations, or lifecycle controls for cost. Production may need high-performance storage while non-production uses a lower-performance option.
Block storage options for transactional IOPS divide data into chunks stored as separate blocks with unique addresses, and applications access data by referencing those block addresses. Block storage is optimized for high-IOPS workloads such as transaction processing and is similar to on-premises storage area network and directly attached storage systems. In Google Cloud, block options are part of Compute Engine and attach to Compute Engine virtual machines (VMs) and Google Kubernetes Engine (GKE) clusters.
The choice depends on durability and performance boundaries. Traffic flows from the VM to the attached disk, and the disk depends on the host for availability. Persistent Disk and Hyperdisk are network storage that can be shared between VMs and scaled up, while Local SSD sits inside the host for lowest latency but is ephemeral and not shareable or scalable. Choose Local SSD only when temporary scratch or cache can be lost, and choose Persistent Disk or Hyperdisk when transactional data must survive host failure.
Low-latency design with Cloud Bigtable centers on a managed database service for operational data that must stay available across zones in a region. A production instance has a minimum of two clusters, and the clusters must sit in unique zones in the region. Replication between clusters in the same instance is automatically managed by Google, so data flows from the primary cluster to the other cluster and each zone holds a separate, independent copy. Incoming traffic can fail over to another cluster in the same instance when one zone has a problem.
Bigtable also supports asynchronous replication of datasets across zones and backup flows that preserve both schema and data. A backup saves a copy of a table schema and data and then restores from that backup to a new table at a later time. Tables can also be exported from Bigtable as Hadoop sequence files, those files can be stored in Cloud Storage, and the files can be used to import data back into another Bigtable instance. For low-latency design, storing indexes in random access memory (RAM) is essential, which means machines must be scaled vertically together with storage capacity to account for the primary index, while a single node can handle data chunks of several hundred terabytes or even petabytes.
Transactional backup flows with Cloud Spanner preserve operational data outside the live database for recovery. Data flows from Spanner through Dataflow to Cloud Storage for durable backup storage. A Dataflow template performs a full export of a Spanner database to a set of Avro files in a Cloud Storage bucket, and another template re-imports the exported files into a new Spanner database. For more controlled backups, the Dataflow connector lets code read and write Spanner data inside a Dataflow pipeline, for example to copy data out of Spanner and into Cloud Storage as the backup target.
This export-to-object pattern separates the live transactional boundary from the recovery boundary. The live database serves operational reads and writes, while Cloud Storage holds the portable Avro copy that can rebuild a new database after corruption, deletion, or regional loss. Choose the full-template export when a complete point-in-time copy is enough, and choose connector-based code when selective copying or custom transformation is needed before data lands in Cloud Storage.
Object storage classes for read-heavy access define how Cloud Storage serves real-time and frequent reads at low cost. Cloud Storage is low-cost, highly durable, and highly scalable object storage with no lower or upper limit. Data is stored as objects in a flat hierarchy of buckets, each object has a globally unique ID plus system-assigned and user-defined metadata, and applications access data by referencing object IDs through REST APIs or client libraries. Data stored in Cloud Storage can be accessed from anywhere inside and outside Google Cloud, capacity scales automatically with usage, and optional redundancy across regions provides high availability and reliability.
Real-time and read-heavy patterns depend on access frequency and retention time. Autoclass automatically transitions objects in a bucket to appropriate classes based on each object access pattern when frequency varies or retention is unpredictable. Standard serves frequently accessed data such as high-throughput analytics, data lakes, websites, streaming video, and mobile apps, with Cloud CDN caching data close to clients and Rapid Cache improving read performance and reducing transfer cost for read-heavy workloads with infrequent changes.
| Storage class | Access pattern | Minimum retention |
|---|---|---|
| Standard | Frequently accessed data, including analytics, data lakes, websites, streaming, and mobile apps | None stated, for active data |
| Nearline | Infrequently accessed data such as backups and long-tail multimedia content | At least 30 days |
| Coldline | Infrequently accessed data such as disaster recovery copies | At least 90 days |
| Archive | Rarely accessed data such as regulatory archives, at lowest cost | At least 365 days |
Exam tip: Use Standard with Rapid Cache or Cloud CDN for frequent reads, while Nearline requires 30 days, Coldline requires 90 days, and Archive requires 365 days.
Use BigQuery partitioning when frequent filters are on DATE, TIMESTAMP, or integer columns, and use BigQuery clustering instead when the frequent filter is a string column. Partitioned tables divide a large table so queries with predicate filters on the partitioning column scan less data, which reduces bytes processed and slot consumption. Clustering stores rows ordered on disk based on columns that are often accessed together and helps retrieval when clustered columns are used as filter or aggregation predicates.
BigQuery on-demand pricing charges for bytes processed by each query, while BigQuery capacity-based pricing purchases slot reservations with a minimum of 100 slots through yearly or three-year commitments. On-demand pricing is chosen when query volume is variable and partition pruning controls cost, while capacity-based pricing is chosen when enterprise reporting and extract-load-transform (ELT) workloads need predictable capacity.
Virtual Private Cloud (VPC) Service Controls create service perimeters at the project or Virtual Private Cloud (VPC) network level that minimize data exfiltration risk for shared data. Traffic from a trusted workload inside the perimeter can reach Cloud Storage, BigQuery, and other Google APIs, while requests from outside the perimeter are denied even when the caller has an Identity and Access Management (IAM) permission.
A multinational financial services company is re-architecting its core payment processing and ledger management system on Google Cloud. The system architecture must satisfy the following technical requirements:
Which database solution and schema design strategy should the company implement?
Last updated