# How to Track State with Type 2 Dimensional Models

DevFeed: [How to Track State with Type 2 Dimensional Models](<https://devfeed.tech/articles/how-to-track-state-with-type-2-dimensional-models-1650.md>)

Original publisher: [Read original article](<https://shopify.engineering/track-state-type-2-dimensional-models>)

Author: Ian Whitestone

Published: 2020-08-27T14:00:00Z

Content type: tutorial

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [AI, ML & Data Engineering](<https://devfeed.tech/topics/ai-ml-data-engineering.md>)

Tags: [data](<https://devfeed.tech/tags/data.md>), [databases](<https://devfeed.tech/tags/databases.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [models](<https://devfeed.tech/tags/models.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

## AI overview

A tutorial on using Type 2 dimensional models to preserve historical state for analytics, contrasting them with Type 1 models that store only current state. It introduces PySpark and dbt as tooling for building these models.

## Source excerpt

In this post, I'll show how you can create Type 2 dimensional models using modern ETL tooling like PySpark and dbt (data build tool).