CertSafari
    Snowflake SnowPro Advanced: Architect (ARA-C01)· Lessons

    Domain 2 · Lesson 4/13

    Star schema, Data Vault and key constraints in Snowflake

    Outline the benefits and limitations of various data models in a Snowflake environment.

    19 min read
    6% of exam
    8 sources
    Published 20 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Recognise a star schema and explain why its denormalized dimensions keep BI queries fast, and what that denormalization costs
    • Describe Data Vault hubs, links and satellites, when Data Vault fits better than a star schema, and the trade-off between hash keys and natural keys
    • State which constraints Snowflake enforces on standard tables and on hybrid tables
    • Explain what the ENABLE, VALIDATE and RELY properties do, and how RELY lets the optimizer eliminate unnecessary joins

    Key concept

    Informational constraints — On standard Snowflake tables, PRIMARY KEY, UNIQUE and FOREIGN KEY constraints are recorded as metadata but not enforced. Only NOT NULL and CHECK block bad rows. A data model's key relationships are therefore only as accurate as the pipelines that load the tables, unless you tell the optimizer to trust them with RELY.

    1.Star schema: a fact table surrounded by dimensions

    A data model decides how many tables a query has to cross, where descriptive attributes live, and what has to change when a source system changes. Snowflake doesn't require any particular model. You can pick a star schema, Data Vault or a normalized design and run it on the same platform. Two models come up most often in Snowflake architecture: the star schema, built for people who query the data, and Data Vault, built for integrating many sources. Both depend on key relationships between tables, and Snowflake records those relationships on standard tables without enforcing most of them.

    A star schema has a central fact table joined directly to a ring of dimension tables. The fact table holds one row per business event, such as one row per sale. Each row carries the measures (units sold, amount) and a foreign key to each dimension. A dimension table holds one row per thing being described, such as a product, a customer or a date. Snowflake's own examples use this pair of tables: fact_sales with a product_id and units_sold, and dim_products, where product_id uniquely identifies each product.

    The defining choice is that each dimension is denormalized. A PRODUCT dimension stores category, subcategory, brand and supplier name in one wide row, so it doesn't split them into lookup tables. That is what separates a star schema from its neighbours. A normalized snowflake schema breaks the same dimension into a chain of sub-tables (product, then subcategory, then category). Third normal form removes redundancy across many related tables. Data Vault separates business keys from descriptive attributes altogether. If you see a description of a fact table joined directly to single-table CUSTOMER, PRODUCT and DATE dimensions, each holding all of its descriptive attributes, that describes a star schema.

    The main benefit is shallow, predictable join depth. Every dimension is one join away from the fact table, so a query filtered on brand, region or fiscal month costs about the same number of joins whichever filters an analyst picks. Ad hoc drill-down in a dashboard stays fast even when the filters change on every click. The structure also suits BI tools: they read the declared foreign keys and generate joins from them, so developers don't each guess at the join path. Tableau goes further and uses the constraints to drop joins it doesn't need.

    The limitations come from the same denormalization. A brand name or supplier name is stored on every product row that shares it, so the dimension's storage grows with its row count, not with the number of distinct brands. Flattening a hierarchy into one table also means that renaming something at any level (a supplier renaming a brand, a category being renamed) is a wide update to every dimension row that references it. The fact table isn't affected, because it holds only measures and keys, not descriptive text. The other limitation is rigidity. Adding a new source system usually means reshaping a dimension that downstream reports already depend on, and Data Vault is designed to avoid exactly that.

    Checkpoint 1 of 8· Check yourself

    An architect builds a star schema on standard Snowflake tables. They declare a PRIMARY KEY on dim_products.product_id and a FOREIGN KEY on fact_sales.product_id that references it. What do these declarations give the design?

    Checkpoint 2 of 8· Exam question

    A data architect describes a Snowflake schema design where a central fact table storing sales transactions is directly joined to denormalized dimension tables such as CUSTOMER, PRODUCT, and DATE, each containing all descriptive attributes in a single table. Which data modeling approach does this describe?

    Checkpoint 3 of 8· Exam question

    A BI team building executive dashboards in Tableau reports that ad hoc drill-down queries against the star-schema sales mart run consistently fast, even though analysts frequently change which dimensions they filter on. Which characteristic of the star schema design best explains this consistent performance?

    Checkpoint 4 of 8· Exam question

    A retail analytics team maintains a star schema where the PRODUCT dimension stores category, subcategory, brand, and supplier name directly in one wide table. Six months after launch, the team notices they must update thousands of dimension rows whenever a supplier renames a brand, and storage for the dimension table has grown faster than the count of distinct products. Which TWO limitations of the star schema design explain what the team is experiencing? (Select 2)(Select 2)

    0 of 2 selected

    Sources12345

    2.Data Vault: hubs, links and satellites

    Data Vault splits each business concept into three kinds of table, each with one job. A hub holds the business keys, such as a customer identifier, after they have been cleaned up ("treated"). A link records a relationship between hubs. Links are built for many-to-many (associative) relationships, and the same link table can also hold mandatory one-to-one or one-to-many relationships and optional ones. A satellite holds descriptive attributes and their history, and every satellite hangs off either a hub or a link. Transactional content usually goes into a link-satellite.

    Data Vault is a better fit than a star schema when the integration layer has to absorb many sources and frequent change. A new source adds new satellites, and possibly new hubs or links, instead of forcing a change to existing tables. History builds up in satellites without rewriting anything. The cost is joins. Answering a business question means crossing hubs, links and satellites, which is why teams usually still serve dashboards from a star schema built on top of the vault.

    Semi-structured data fits this pattern on Snowflake. A satellite can keep the original JSON or XML payload in a dv_object column of type VARIANT, so new attributes from the source don't force a refactor. Semi-structured content is slower to query than typed columns, though, especially when it is nested. During staging, the essential attributes (the business event timestamp, the business key, a source event ID) are extracted into strongly typed columns in the same satellite. Those columns make queries faster and can improve pruning. Nested content is left unflattened at load time, because flattening during ingestion delays loading the satellite.

    The key choice is hash keys versus natural keys. A hash key is one binary value computed with sha1_binary over three things joined by a || separator: a tenant id (which tenant's data the row belongs to, for multi-tenant vaults), a business key collision code (a label stored alongside the key), and the treated business key itself, trimmed and upper-cased, with -1 standing in for a missing key. Because those pieces fold into a single column, hubs, links and satellites all join on that one hashed column. Natural keys skip the hashing, which you might choose if hashing business keys is costly and slow to load. The price is that the tenant id, collision code and key value can't be folded away: they must be stored in every satellite so it can join to each of its hubs, and every join has to match on all of those columns. Hash keys cost more when loading and make joins simpler when querying; natural keys are the reverse. Pick one approach for the whole vault, because mixing the two makes the vault inconsistent to use.

    How hubs, links and satellites divide the work
    Table typeHoldsNotes on Snowflake
    HubTreated business keysThe cleaned business key extracted in staging is loaded here
    LinkRelationships between hubsDesigned for many-to-many cardinality; can also hold 1:1, 1:M and optional relationships
    SatelliteDescriptive attributes, child of a hub or a linkCan keep the raw payload in a VARIANT dv_object column, plus typed columns for essential attributes

    Hub, link and satellite relationships are key relationships like any others. Declaring them as primary and foreign keys documents the design and lets tools see how the tables connect. On standard tables, though, the loading process, not Snowflake, keeps a satellite from pointing at a hub row that doesn't exist.

    Checkpoint 5 of 8· Check yourself

    A Data Vault team on Snowflake loads a JSON feed into a satellite. The source adds new attributes often, and analysts filter on the business event timestamp and the business key. Which satellite design follows the guidance for semi-structured data?

    Sources35

    3.What Snowflake enforces, and what it only records

    Snowflake supports the five ANSI constraint types: PRIMARY KEY, UNIQUE, FOREIGN KEY, NOT NULL and CHECK. You can declare them inline on a column or out-of-line as a separate clause. Multi-column keys must be declared out-of-line. A table can have several unique and foreign keys but only one primary key, and a primary key implies NOT NULL plus UNIQUE.

    An out-of-line primary key on salespeople and a foreign key from salesorders that references itsql
    CREATE OR REPLACE TABLE salespeople (
      sp_id INT NOT NULL UNIQUE,
      name VARCHAR DEFAULT NULL,
      region VARCHAR,
      constraint pk_sp_id PRIMARY KEY (sp_id)
    );
    CREATE OR REPLACE TABLE salesorders (
      order_id INT NOT NULL UNIQUE,
      quantity INT DEFAULT NULL,
      description VARCHAR,
      sp_id INT NOT NULL UNIQUE,
      constraint pk_order_id PRIMARY KEY (order_id),
      constraint fk_sp_id FOREIGN KEY (sp_id) REFERENCES salespeople(sp_id)
    );

    On a standard table, only NOT NULL and CHECK block bad data. Copying or inserting a NULL into a NOT NULL column raises an error. A CHECK constraint is evaluated on INSERT, UPDATE, MERGE and CTAS, and fails only when its condition evaluates to FALSE (TRUE or NULL lets the row through). PRIMARY KEY, UNIQUE and FOREIGN KEY are accepted and stored, but Snowflake doesn't check them. A report that returns two rows for one invoice_id declared as the primary key isn't a bug: an upstream load inserted the duplicate, and nothing stopped it. These constraints exist mainly for data modeling, for compatibility with other databases, and for client tools that read them.

    Hybrid tables are a separate Snowflake table type whose constraints are enforced, where standard tables only record most of them. A primary key is required and enforced, and FOREIGN KEY and UNIQUE constraints are enforced when you declare them. You can't mark these constraints NOT ENFORCED on a hybrid table; trying it raises an invalid constraint property error.

    Constraint enforcement on standard and hybrid tables
    ConstraintStandard tablesHybrid tables
    PRIMARY KEYOptional, not enforcedRequired, enforced
    FOREIGN KEYOptional, not enforcedOptional, enforced (referential integrity)
    UNIQUEOptional, not enforcedOptional, enforced
    NOT NULLOptional, enforcedOptional, enforced
    CHECKOptional, enforcedOptional, enforced; can be defined only at table creation

    CHECK constraints come with an architectural cost: COPY INTO a table that has a CHECK constraint fails, and so does creating a pipe that targets one. If a star schema or vault table is loaded in bulk, the quality rule may have to live in the pipeline instead of on the table.

    Checkpoint 6 of 8· Match them up

    Match each constraint and table type to how Snowflake treats it.

    Tap a term, then the definition that fits it.

    Sources46

    4.ENABLE, VALIDATE and RELY

    Snowflake accepts a set of constraint properties so that DDL migrated from other databases still runs. ENABLE | DISABLE, VALIDATE | NOVALIDATE and RELY | NORELY are Snowflake extensions; the rest (ENFORCED, DEFERRABLE, INITIALLY) are ANSI. On standard tables Snowflake neither enforces nor maintains these properties. Writing a non-default value doesn't switch enforcement on. Instead, Snowflake doesn't create the constraint at all. RELY is the one exception.

    What each property means and its default
    PropertyMeaningDefault
    ENABLE / DISABLEWhether the constraint is enabled; provided for compatibility with OracleDISABLE
    VALIDATE / NOVALIDATEWhether existing data is validated when the constraint is createdNOVALIDATE for PRIMARY KEY and FOREIGN KEY; VALIDATE for CHECK
    RELY / NORELYWhether a NOVALIDATE constraint is taken into account during query rewriteNORELY
    ENFORCED / NOT ENFORCEDWhether the constraint is enforced in a transaction; on standard tables only NOT NULL and CHECK are enforced regardlessNOT ENFORCED

    For CHECK constraints, ENABLE VALIDATE and ENABLE NOVALIDATE have a real effect. ENABLE VALIDATE, the default, enforces the rule on existing rows and on every new or changed row, but it is only supported for new tables. ENABLE NOVALIDATE enforces the rule only on rows inserted or updated after the command runs, so existing rows aren't checked. Changing a CHECK from NOVALIDATE to VALIDATE first enforces it against every existing row.

    After creation, a constraint can be renamed and RELY can be toggled with ALTER TABLE … ALTER CONSTRAINT. Properties such as DEFERRABLE can't be changed in place, so the constraint has to be dropped and recreated. Snowflake doesn't support setting ENFORCED. On a hybrid table, adding a UNIQUE or FOREIGN KEY with ALTER TABLE always validates the rows already in the table, whatever VALIDATE is set to.

    Checkpoint 7 of 8· Check yourself

    A DDL script migrated from Oracle creates a standard Snowflake table with the clause CONSTRAINT pk_invoice PRIMARY KEY (invoice_id) ENABLE VALIDATE. What is the result?

    Sources78

    5.RELY and join elimination

    RELY tells the optimizer to trust a constraint it has never checked. It doesn't validate data, it doesn't enforce anything, and it doesn't stop a bad row from loading later. Its only effect is that the constraint can be used during query rewrite. You set it once you have confirmed that the data really follows the key, for example after a data quality check showing every customer_id in ORDERS exists in CUSTOMER. For a primary key and foreign key pair, set it on both.

    Setting RELY on both sides of a primary key / foreign key relationshipsql
    ALTER TABLE table_with_primary_key ALTER CONSTRAINT a_primary_key_constraint RELY; ALTER TABLE table_with_foreign_key ALTER CONSTRAINT a_foreign_key_constraint RELY;

    The optimization RELY unlocks is join elimination: the optimizer drops a join that can't change the result. This matters most in star schemas, where generated BI queries often join a dimension they never read from. Take this query against fact_sales:

    A left outer join that reads nothing from the dimensionsql
    SELECT f.*
    FROM fact_sales f
    LEFT OUTER JOIN dim_products p
    ON f.product_id = p.product_id;

    No column from dim_products is selected apart from the join key. If dim_products.product_id has a UNIQUE or PRIMARY KEY constraint with RELY, every fact row matches at most one product, so Snowflake can drop the reference to dim_products. A redundant self-join on that key can be removed the same way. An inner join needs both sides: a PRIMARY KEY on dim_products.product_id and a FOREIGN KEY on fact_sales.product_id. That guarantees every fact row has exactly one match, so removing the join can't drop or duplicate rows.

    The risk sits with you. Because standard tables don't enforce these keys, a RELY constraint over data that has drifted (a duplicate product_id, an orphaned fact row) makes query results differ from what NORELY would return. DML and CTAS statements built on those queries can then write incorrect data. Set RELY only where the load process guarantees uniqueness and referential integrity, and run the data quality check again whenever that process changes.

    Checkpoint 8 of 8· Fill the gap

    dim_products.product_id has a PRIMARY KEY constraint with RELY. fact_sales.product_id has no foreign key declared. Which join type lets Snowflake drop dim_products from this query?

    SELECT f.*
    FROM fact_sales f
     ?  OUTER JOIN dim_products p
    ON f.product_id = p.product_id;

    Sources72

    Sources

    (8)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “A simple star schema (a central fact table joined to dimension tables) is a good starting point.”
      ↩︎ Star schema: a fact table surrounded by dimensions
    2. 2.
      “fact_sales is a table that contains a row for each sale of a product.”
      ↩︎ Star schema: a fact table surrounded by dimensions
      “dim_products is a table that contains a row for each product available for purchase.”
      ↩︎ Star schema: a fact table surrounded by dimensions
      “These optimizations are performed only if you use the RELY constraint property to indicate that the data in your tables complies with the constraints”
      ↩︎ RELY and join elimination
      “If the dim_products.product_id column has the PRIMARY KEY constraint and the fact_sales.product_id column has the FOREIGN KEY constraint”
      ↩︎ RELY and join elimination
      “the query results might differ if the RELY constraint property is set (compared to the results with NORELY).”
      ↩︎ RELY and join elimination
    3. 3.
      “most business intelligence (BI) and visualization tools import the foreign key definitions with the tables and build the proper join conditions.”
      ↩︎ Star schema: a fact table surrounded by dimensions
      “Primary and foreign keys enable your project team to understand the schema design and see the relationships between the tables and their columns.”
      ↩︎ Data Vault: hubs, links and satellites
      “referential integrity constraints, as defined by primary-key/foreign-key relationships, are informational; they are not enforced.”
      ↩︎ Prediction
    4. 4.
      “For example, Tableau supports using constraints to perform join culling (join elimination), which can improve the performance of generated queries and cube refresh.”
      ↩︎ Star schema: a fact table surrounded by dimensions
      “doesn’t enforce them, except for NOT NULL and CHECK constraints, which are always enforced.”
      ↩︎ What Snowflake enforces, and what it only records
      “Constraints on standard tables are provided primarily for data modeling purposes and compatibility with other databases”
      ↩︎ What Snowflake enforces, and what it only records
      “Primary key constraints are required and enforced on all hybrid tables, and other constraints are enforced when used.”
      ↩︎ What Snowflake enforces, and what it only records
      “doesn’t enforce them, except for NOT NULL and CHECK constraints, which are always enforced.”
      ↩︎ Key concept
      “For standard tables, Snowflake supports defining and maintaining constraints, but doesn’t enforce them, except for NOT NULL and CHECK constraints, which are always enforced.”
      ↩︎ Checkpoint
    5. 5.
      “giving you the freedom to choose your data model methodology for the cloud”
      ↩︎ Star schema: a fact table surrounded by dimensions
      “A satellite is either the child table of a hub or a link table.”
      ↩︎ Data Vault: hubs, links and satellites
      “link tables are designed to serve many-to-many/associative (M:M) cardinality”
      ↩︎ Data Vault: hubs, links and satellites
      “the treated business key is sent to the hub table”
      ↩︎ Data Vault: hubs, links and satellites
      “This new column will store the original semi-structured data as data type VARIANT.”
      ↩︎ Data Vault: hubs, links and satellites
      “Semi-structured content is slower to query”
      ↩︎ Data Vault: hubs, links and satellites
      “those natural keys must persist in the satellite table to join to all of the respective hub tables”
      ↩︎ Data Vault: hubs, links and satellites
      “the act of hashing business keys to produce hash-keys is costly and time-consuming”
      ↩︎ Data Vault: hubs, links and satellites
      “business key collision codes and multi-tenant ids means that you must include these columns in every SQL join”
      ↩︎ Data Vault: hubs, links and satellites
      “queries running on this satellite will essentially need to use more columns to join”
      ↩︎ Exam trap 4
      “you need to persist those key-pairs as strongly typed structured columns within the same satellite table”
      ↩︎ Checkpoint
    6. 6.
      “A PRIMARY KEY constraint implies that the column is both NOT NULL and UNIQUE.”
      ↩︎ What Snowflake enforces, and what it only records
      “If the condition evaluates to TRUE or NULL, the DML operation proceeds.”
      ↩︎ What Snowflake enforces, and what it only records
      “If you attempt to COPY INTO a table with CHECK constraints, the operation fails.”
      ↩︎ What Snowflake enforces, and what it only records
    7. 7.
      “changing the defaults results in Snowflake not creating the constraint.”
      ↩︎ ENABLE, VALIDATE and RELY
      “These properties are provided for compatibility with Oracle.”
      ↩︎ ENABLE, VALIDATE and RELY
      “Default for PRIMARY KEY and FOREIGN KEY constraints: NOVALIDATE”
      ↩︎ ENABLE, VALIDATE and RELY
      “Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.”
      ↩︎ RELY and join elimination
      “For related PRIMARY KEY and FOREIGN KEY constraints, set this property on both constraints.”
      ↩︎ RELY and join elimination
      “For standard tables, NOT NULL and CHECK are the only types of constraints that are enforced by Snowflake, regardless of this property.”
      ↩︎ Exam trap 1
      “If the RELY property is set for a constraint and a violation of referential integrity occurs, DML and CTAS statements might insert incorrect data.”
      ↩︎ Exam trap 2
      “changing the defaults results in Snowflake not creating the constraint.”
      ↩︎ Exam trap 3
      “This means that the defaults can be changed for these properties, but changing the defaults results in Snowflake not creating the constraint.”
      ↩︎ Checkpoint
    8. 8.
      “Snowflake doesn’t support setting ENFORCED.”
      ↩︎ ENABLE, VALIDATE and RELY
      “Some properties can be modified; for example, RELY.”
      ↩︎ ENABLE, VALIDATE and RELY

    Spotted a mistake, or was something unclear? Tell us.