Chris Vizes Data visualisation and more

Models

Learning Objectives

  1. Explain what models are in a dbt project.
  2. Build your first dbt model.
  3. Explain how to apply modularity to analytics with dbt.
  4. Modularize your project with the ref function.
  5. Review a brief history of modeling paradigms.
  6. Identify common naming conventions for tables.
  7. Reorganize your project with subfolders.

Sources (src) raw data loaded into warehouse. These are not models and purely configuration yml.

Categories of models

Staging (stg) is 1-to-1 with the source data and includes light touch changes, column renames, convert units from seconds to hours.

Intermediate models (int) somewhere between staging and final models. Might not be for end users. Only reference staging models, not source.

Marts rich, business-user, ready models. These may be in the form of, but not limited to be:

  1. Fact models (fct) records of events, like orders, or website traffic.
  2. Dimension models (dim) records of things that you keep up-to-date, like contacts or product inventory.

What’s the configuration?

Config, like how to materialize a model, can be within the model but it may be more efficient to use the project yml file to set what each folder is matialized as. Here you are defining how dbt treats various objects in your project, from tests to documentation.