Designing Dimensional Schemas and Slowly Changing Dimensions
This lesson explains how schemas are designed for how data will be used, which in analytics usually means dimensional models and a decision about how to record changes to descriptive attributes over time.
Learning outcomes
After completing this lesson, you will be able to:
- Choose a schema design approach for each kind of store.
- Distinguish fact tables from dimension tables.
- Distinguish SCD Type 1, Type 2 and Type 3.
Design by store
Each kind of store calls for its own approach to schema design. In Redshift, data is modelled dimensionally, usually as star schemas: a central fact table records events, such as sales, with numeric measures and keys, and surrounding dimension tables describe the who, what and where, such as customers and products. In DynamoDB, the design starts from the application's access patterns, the exact queries it must serve, and keys are chosen to answer each one efficiently, since there are no joins. In a data lake, data is organised into zones and partitioned tables registered in the Data Catalog. The following table summarises the approaches.
| Store | Design approach |
|---|---|
| Redshift | Dimensional models: star schemas of fact tables (events) and dimension tables (attributes) |
| DynamoDB | Model around access patterns |
| Data lake | Zoned, partitioned tables registered in the Data Catalog |
Design approach by store
Facts and dimensions
Dimensional models separate measurements from their context, which makes analytical queries simple and fast. Fact tables record events or measurements, such as sales, at a declared grain, the level of detail of each row, for example one row per order line. Declaring the grain first prevents mixing levels of detail that would make sums wrong.
Dimension tables describe the context of each fact: the customer, the product, the store and the date. Surrogate keys, generated by the warehouse, link facts to dimension rows independently of source system keys, which allows several versions of a dimension row to exist and keeps the model stable when source systems change. Arranged with the fact table in the centre, this forms a star schema. A snowflake schema normalises dimensions further, for example moving product categories into their own table, which reduces duplication at the cost of more joins.
Dimensional modelling
Slowly changing dimensions (SCD)
Dimension attributes change over time, such as a customer moving to another city, and the SCD type decides whether history is kept. Type 1 overwrites the old value, so reports always show the current value and history is lost; it suits corrections. Type 2 adds a new row for each change, with effective dates and a current flag, so each sale stays linked to the customer's city at the time; this keeps full history and is the most common choice when history matters. Type 3 keeps the previous value in an extra column, which allows comparing current with previous but keeps only limited history. The following table summarises the types.
| Type | How changes are handled | History |
|---|---|---|
| Type 1 | Overwrite the old value | None |
| Type 2 | Add a new row with effective dates and a current flag | Full |
| Type 3 | Keep the previous value in an extra column | Limited |
Type 2 dimensions are built with MERGE in Redshift or Iceberg: changed rows are closed by setting their end date, and new versions are inserted.
The following diagram shows a Type 2 customer dimension's rows and the orders that reference them.

Tracking a customer's address history
A customer moves from Leeds to Bristol. Reports on last year's sales must still show the Leeds address for orders placed then, while current reports show Bristol. This calls for a Type 2 slowly changing dimension, whose rows are shown in the following table.
| customer_key | customer_id | city | valid_from | valid_to | is_current |
|---|---|---|---|---|---|
| 1001 | C-42 | Leeds | 2023-01-10 | 2026-09-30 | false |
| 1874 | C-42 | Bristol | 2026-10-01 | 9999-12-31 | true |
Each order references the surrogate key that was current when it was placed. A Type 1 dimension would simply overwrite the city and lose the history.
Which slowly changing dimension type keeps the full history of changes?
Show answer
Type 2, which adds a new row for each change. Type 1 overwrites the old value.
Exam Tips
Remember for the exam
- To keep the full history of dimension changes, use SCD Type 2.
- To overwrite without keeping history, use SCD Type 1.
- Star schemas join fact tables to dimension tables through surrogate keys.
- Declare the grain of each fact table.
- Build Type 2 dimensions with MERGE in Redshift or Iceberg.