Data Modelling in dbt

In my previous blog posts, we explored what dbt models are, how they can be used to transform raw data and how they connect to one another using source() and ref().

Knowing how to organise various models in a dbt project is just as important as knowing how to create and connect them.

As a project grows and the number of models increases, having a clear structure becomes increasingly important. Without a clear structure, it can become difficult to understand where transformations are taking place, what is happening in each model, and which datasets should be used for analysis and reporting.

This is where data modelling comes in. In this blog I'll explore different approaches to data modelling and dbt best practice for structuring models in a project.

What is data modelling?

Data modelling refers to the process of defining how data is structured, organised and related to other data.

The way in which data is modelled can greatly impact how easy it is to understand, maintain and analyse, as well as how efficiently it can be queried.

Various data modelling methods have been developed over the years, e.g.: dimensional modelling, star schema, snowflake schema, data vault, medallion architecture etc. Each approach has it's own purpose, advantages and limitations. The best or most suitable approach will often depend on the requirements of the organisation.

When exploring data modelling, two important concepts are normalisation and denormalisation.

What is normalisation?

Normalisation is the process of organising data into separate, related tables to reduce data duplication and improve data integrity.

For example, if we have a dataset that contains information about customers orders:

Every time a customer places an order, their name and city are repeated, as seen with Chloe. With normalisation, we would separate the information into two tables:

The two tables can then be joined using the customer_id field whenever customer information is needed with the order information. This reduces unnecessary duplication and makes it easier to maintain the data. For example, if a customer moves to a different city their information only needs to be updated in one place.

This is very useful in operational databases where data is frequently inserted, updated or deleted. However, retrieving information from highly normalised databases often require multiple joins, which can make queries more complex.

What is denormalisation?

Denormalisation combines related data into fewer tables, such that there is a degree of duplication.

For example, in the above customers order table, instead of having to do several joins to understand the customer purchasing behaviour, denormalisation would leave us with a model with the following information:

Although this requires more storage than normalised data, it can also make data easier to understand and query, especially for analytical purposes.

Historically, storage limitations made reducing data duplication important. However, with the development of modern cloud data platforms, storage has become relatively more affordable and computing capabilities have improved. This has allowed data teams to have greater flexibility to design analytical datasets with readability, usability, and query performance in mind, as well as storage efficiency.

One thing to note is that neither normalisation or denormalisation is better than the other. Both serve different purposes.

Data modelling in dbt

A benefit of dbt is that it doesn't restrict users to a specific data modelling method, allowing users to use the approach which is most suitable for the organisation and it's requirements.

However, the best practice recommended by dbt is to organise transformations into different layers, with each layer serving a specific purpose. These layers typically consist of:

  • sources
  • staging models
  • intermediate models
  • marts

As data moves through each of these layers, it goes through transformations to gradually become more refined, structured and aligned with the needs of the business.

Sources

Sources act as the starting point for our transformation pipeline. As in my previous blog post, this refers to raw data that has been loaded into a data warehouse and been defined within a dbt project. This data may come from various systems such as customer databases, payment platforms, CRM systems or other operational applications.

At this stage, the data may often contain inconsistent column names, unsuitable data types, unnecessary fields or values that requires further standardisation.

Staging models

This is the first layer of transformations within a dbt project. The main purpose is to clean and standardise source data, in order to create a consistent foundation for more complex transformations further downstream.

Staging models should generally avoid complex business logic, joins between different source tables and aggregations that change the granularity of the data, and should rather be focused on more simple transformations that cleans the data to get it into a state that you ideally would have wanted the data to look when it was first loaded into the warehouse. Such transformations typically include renaming columns, casting appropriate data types, performing simple calculations etc.

One thing to note is that there should be one-to-one relationship between source tables and staging models, i.e. each source table should typically have one corresponding staging model. This ensures that there is only one centralised version of each cleaned source table that can then be referenced by other models throughout the project.

Intermediate models

These are models that sit between the staging models and the final analytical models, which are typically found within the marts layer, and is also where more complex transformations and business logic is applied.

The types of transformations that typically happen in intermediate models consist of joining multiple staging models, aggregating data, performing complex calculations, applying business rules and anything else that can be used and referenced in models further downstream.

Intermediate models may not always be required in a project, particularly if the required transformations are relatively simple.

Marts

This is the layer where data is organised around specific business processes, entities or analytical requirements. For example, it can be organised around the Finance team, Sales team, Operations etc. By the time the raw data has reached this stage, it has been cleaned, standardised and transformed into datasets that are suitable for consumption by downstream users such as analysts, BI teams and tools.

A common approach to organise models within the marts layer is with the use of fact and dimension tables.

Fact and Dimension Tables

Fact tables are tables that typically represent business events, activities or processes, such as customer orders, financial transactions etc. They often include measurable values such as revenue and quantity sold as well as keys that connect them to a related dimension table.

However, not all fact tables need to have numerical values, some may simply record that a particular event has occurred.

It's important to consider the grain when creating a fact table, i.e. what each row in the table represents.

Dimension tables on the other hand typically contain descriptive information about business entities, which provides additional context to the events recorded within fact tables. Examples of dimension tables include customers, products, employees, etc. These tables provide the context of who, what, where and when behind business events.

A common characteristic of fact tables is that they often have a tall and narrow structure, while dimension tables are typically wider and contain more descriptive columns.

Connecting dimension and fact tables provides greater insight that enables you to answer business questions.

When a central fact table is connected to multiple dimension tables, this is often referred to as a star schema. This is often useful for BI reporting, as it provides a clear and intuitive way to organise and analyse data.

How does this compare to the medallion architecture?

Medallion architecture is a common approach used when organising data. It separates data into three main layers:

  • Bronze - raw data that has been minimally processed (or not at all)
  • Silver - cleaned, validated and refined data
  • Gold - data that has been structured for analytical consumption and ready to be used by the business

There are some similarities between the medallion architecture and the dbt recommended approach to organising projects, for example sources may typically correspond to the bronze layer, staging and some intermediate models may correspond to the silver layer and marts may correspond to the gold layer. However these are not strict equivalents.

Medallion architecture describes broader layers of data refinement, while dbt's staging, intermediate and marts layers describe how transformation models can be organised within a project. Depending on the architecture of an organisation, dbt may be used to implement transformations across multiple medallion layers.

The key takeaway here is that dbt provides the flexibility to work with different data modelling approaches rather than enforcing a particular architecture.

Author:
Amy Afriyie
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2026 The Information Lab