professional-cloud-data-engineer
Normalization organizes relational data across separate tables to eliminate redundancy and maintain write integrity, whereas denormalization groups related fields into wider tables to maximize read performance. Transactional (OLTP) systems like Cloud Spanner rely on normalized schemas to deliver strong consistency, horizontal scalability, and rapid single-row lookups. In contrast, analytical (OLAP) data warehouses like BigQuery process massive datasets through parallel scans, where denormalized tables eliminate expensive join operations. Schema designers must balance write performance and referential integrity against analytical query speed and compute resource limits.
| Workload Architecture | Primary Engine Target | Schema Strategy | Key Architecture Tradeoff |
|---|---|---|---|
| Transactional (OLTP) | Cloud Spanner / Cloud SQL | Normalized relational tables | Enforces write consistency and row-level lookups at the cost of join overhead on large scans |
| Analytical (OLAP) | BigQuery | Denormalized / Semi-normalized | Minimizes shuffle and query latency on scans by storing related data together |
Data warehouse modeling often chooses between a star schema, a snowflake schema, and semi-normalized structures. A star schema organizes data into a central fact table surrounded by denormalized dimension tables, while a snowflake schema further normalizes those dimension tables into multiple related tables. While BigQuery can execute queries across both star and snowflake schemas, its distributed execution engine performs most efficiently when related dimensions are flattened or nested into the same table. Eliminating relational joins across independent tables prevents network shuffle overhead and improves overall execution speed.
Exam tip: Cloud Spanner uses normalized schemas to optimize row-level operations and maintain transactional integrity, whereas BigQuery performs best with denormalized or nested schemas that eliminate relational joins during large-scale data scans.
The degree of data normalization directly controls Google Cloud infrastructure costs by altering storage footprints and query compute requirements. In BigQuery, compute power is measured in slots, which are virtual CPUs allocated to execute SQL operations in parallel across distributed worker nodes. Highly normalized schemas force queries to execute multi-table joins, which consume excessive slot resources and increase shuffle quota contention. Replacing normalized snowflake or star schemas with consolidated flat tables lowers resource consumption and accelerates query execution.
Consolidating multiple dimension tables into a single flat or semi-normalized record provides three main operational benefits:
Optimizing schema design requires continuous performance evaluation and resource tracking under realistic query conditions. Data engineering teams use the Google Cloud Pricing Calculator to estimate compute and storage costs, while Cloud Monitoring and Active Assist identify high slot consumption and inefficient query patterns. Engineers can also use reverse ETL workflows to load representative data subsets and validate query performance under simulated production workloads. Applying table clustering and avoiding query hotspots further stabilizes performance and keeps cloud expenditures predictable.
Semi-normalized schema designs in BigQuery preserve logical entity hierarchies within a single table using nested and repeated fields. A nested field uses the STRUCT data type to store related sub-properties together inside a single container, while a repeated field uses the ARRAY data type to hold an ordered list of elements of the same type. For example, rather than maintaining separate tables for customers and their purchases, order records can be stored as an ARRAY of STRUCT items inside the parent customer row. This structure colocates parent and child data in storage, allowing BigQuery to process complex hierarchical data without executing relational joins.
BigQuery's underlying architecture is purpose-built to read semi-normalized data efficiently without scanning unnecessary fields. The Dremel model query execution engine works directly with the Capacitor columnar storage format to scan only the specific nested attributes requested in a SQL statement. Massively parallel compute workers process contiguous nested records simultaneously, avoiding the inter-worker network communication required by standard table joins. As a result, semi-normalized structures achieve the speed advantages of denormalized tables while maintaining the structured relationships of normalized designs.
Engineers must evaluate workload access patterns to decide when nested and repeated fields provide the greatest advantage over traditional normalization. This approach is most beneficial when queries frequently aggregate or filter child records in the context of their parent entities, such as analyzing order trends by customer account. If child entities are regularly queried, filtered, or updated independently of the parent record, maintaining separate relational tables remains the better approach. Combining nested fields with table clustering organizes records within storage partitions by key columns, optimizing analytical scans even further.
STRUCT types for nested records and ARRAY types for repeated values.Prepare and test your skills
Prepare and test your skills
Transactional systems like Cloud Spanner use normalized relational tables to enforce write consistency and optimize rapid row-level lookups. Analytical systems like BigQuery rely on denormalized or semi-normalized schemas to eliminate expensive join operations and minimize query latency during large-scale data scans.
BigQuery performs more efficiently with denormalized schemas because consolidating related data eliminates multi-table joins, which avoids network shuffle overhead and reduces compute slot resource consumption. Furthermore, storing data in flat tables allows BigQuery's Capacitor columnar format to compress repetitive values and lets compute workers scan colocated records locally.
BigQuery creates nested fields using the STRUCT data type to group related sub-properties together, and repeated fields using the ARRAY data type to hold ordered lists of elements. This structure colocates parent and child data within a single table, allowing the Dremel query engine and Capacitor storage format to scan only the requested nested attributes without executing table joins.
Separate relational tables should be maintained when child entities are regularly queried, filtered, or updated independently of the parent record. Conversely, nested and repeated fields provide the greatest advantage when queries frequently aggregate or filter child records directly in the context of their parent entities.
A data architect is migrating an enterprise e-commerce reporting workload from a normalized relational database to BigQuery. The existing relational model contains a parent Orders table and a child Order_Items table related by an order_id foreign key (a 1-to-many relationship).
The analytical workload frequently aggregates line items per order, but queries that join these multi-billion-row tables across compute slots suffer from significant data shuffling and high slot consumption. The architect has the following requirements:
JOIN operations.How should the architect model this schema in BigQuery?