Data Modeling with Databricks SQL · Topic 1 of 1
Data Models and the Medallion Architecture
Databricks Data Analyst Associate: star, snowflake and data vault schemas, facts, dimensions, hubs and satellites, and their Medallion layers.
- 5 min
- Includes a diagram
- Star: one fact table plus denormalized dimensions; fewest joins; best for BI.
- Snowflake: dimensions normalized into sub tables; less redundancy, more joins.
- Data vault: hubs hold business keys, links hold relationships, satellites hold attributes and history.
What it is
A data model decides how analytical data is split into tables and how those tables relate. The exam covers three standard models: the star schema, the snowflake schema and the data vault.
The Medallion Architecture is the lakehouse pattern of improving data in layers: bronze for raw data, silver for cleaned and integrated data, and gold for business-ready data. Each model has a natural home in one of these layers.
How it works
Star schema
A star schema has one central fact table surrounded by dimension tables. The fact table holds measurable events, such as order lines, with numeric measures and a foreign key to each dimension. Dimensions hold descriptive attributes, such as customer, product and date, and are denormalized into one table each.
Queries join the fact to a few dimensions and aggregate, which makes star schemas fast and easy for BI tools, dashboards and Genie Agents.
SELECT d.year, p.category, SUM(f.net_amount) AS revenue
FROM gold.fact_sales f
JOIN gold.dim_date d ON f.date_key = d.date_key
JOIN gold.dim_product p ON f.product_key = p.product_key
GROUP BY d.year, p.category;
Snowflake schema
A snowflake schema starts from a star but normalizes the dimensions into further tables. For example, product points to a separate category table, and category points to a department table.
This removes repeated attribute values and can make dimensions easier to maintain. The cost is more joins per query, so reporting is usually a little slower and harder to write.
Data vault
A data vault splits data into three kinds of tables:
| Table | Holds |
|---|---|
| Hub | The unique business keys of a core entity, such as customer numbers |
| Link | Relationships between hubs, such as which customer placed which order |
| Satellite | Descriptive attributes and their change history, with load dates and the record source |
New sources or attributes are added as new satellites or links without changing existing tables. Every change is kept as history, which suits auditing and integrating many changing sources. It is not designed for direct reporting, because answering a business question needs many joins.
Comparing the models
| Model | Strength | Weakness | Usual layer |
|---|---|---|---|
| Star | Fast, simple BI queries | Repeated attribute values | Gold |
| Snowflake | Less redundancy in dimensions | More joins | Gold |
| Data vault | Flexible, full history, auditable | Many joins, not for end users | Silver |
Alignment with the Medallion Architecture
Bronze keeps source data as it arrived, so it is not modeled for analysis. Silver cleans and integrates data from several sources; a data vault or a normalized model fits here because it stores integrated history flexibly.
Gold presents data for consumption. Star schemas, sometimes snowflaked, live here and feed dashboards, metric views and Genie Agents.
Keys and constraints in Databricks SQL
Dimension tables often use a surrogate key from an identity column. Unity Catalog tables can declare primary and foreign keys; these are informational and not enforced, but they document the model and help tools understand the joins.
CREATE TABLE gold.dim_customer (
customer_key BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY,
customer_id STRING,
segment STRING,
CONSTRAINT dim_customer_pk PRIMARY KEY (customer_key)
);
Because keys are not enforced, duplicate key values must be prevented by the pipeline that loads the table.
How the exam asks about this
- "Business users need fast dashboard queries over sales by product and month." Build a star schema in the gold layer.
- "Integrate many source systems and keep every historical change, while sources keep changing." Use a data vault in the silver layer.
- "Which data vault table stores a customer's changing address over time?" A satellite.
What to remember for the exam
- Star: one fact table plus denormalized dimensions; fewest joins; best for BI.
- Snowflake: dimensions normalized into sub tables; less redundancy, more joins.
- Data vault: hubs hold business keys, links hold relationships, satellites hold attributes and history.
- Bronze is raw, silver is integrated (data vault fits), gold is business ready (star fits).
- Fact tables hold measures and foreign keys; dimension tables hold descriptive attributes.
- Primary and foreign key constraints in Databricks are informational, not enforced.
Do not point dashboards or Genie Agents straight at data vault tables. Build gold star schemas or views on top so business users get simple, fast queries.
Common mistakes
Mixing up facts and dimensions. Numbers you sum or count, such as amount or quantity, belong in the fact table. Attributes you filter or group by, such as region or category, belong in dimensions.
Calling every normalized model a star. If a dimension points to another dimension table, the model is a snowflake. A star keeps each dimension in a single table.
Expecting key constraints to block duplicates. Databricks primary keys do not reject duplicate rows. Data quality checks in the load pipeline must do that.
Check yourself
Which Medallion layer normally holds a star schema?
The gold layer, because star schemas present business ready data for dashboards, metric views and Genie Agents.
What does a link table hold in a data vault?
The relationships between hubs, such as which customer placed which order, using the hubs' business keys.
How does a snowflake schema differ from a star schema?
A snowflake schema normalizes dimensions into further related tables, which reduces redundancy but adds joins to each query.
Topic 1 of 1 in Data Modeling with Databricks SQL
Test yourself on Data Modeling with Databricks SQL
The full Databricks Data Analyst Associate question bank has 600 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Databricks. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.