Skip to main content
Uncategorized

Understanding modularity

Last week we talked about DBT models. It’s time to dive deeper in understanding modularity.

What is Modularity?

According to the Cambridge Dictionary:

modularity is the quality of consisting of separate parts that, when combined, form a complete whole. A system lacks modularity when a tweak to one of its components affects the functioning of others.”

In the world of dbt (data build tool), building data models is like playing with building blocks. Think about Lego bricks. You can put them together in all sorts of ways to create different things. We take little chunks of our data work (models) and make each one do a specific job.

Photo by Mourizal Zativa on Unsplash

Later, we can mix and match them to build our final data models, like a report that tells us all about our customers.

Photo by Xavi Cabrera on Unsplash

Why should we care about modularity?

When you’ve got one big model doing everything, it’s like trying to carry a bunch of groceries in your arms without bags. Stuff can fall and get messy. But if you use bags (modular models), it’s easier to manage and nothing gets squished.

Here’s what’s great about modularity:

  • It’s clear: Each piece does one thing, so it’s easier to understand.
  • It’s handy: You can use the same piece in different places, like using the same Lego brick in different sets.
  • It’s a team player: Different people can work on different pieces without getting in each other’s way.
  • It’s easy to check: When a piece is on its own, you can make sure it’s right without digging through the whole thing.

How does modularity work on dbt?

dbt doesn’t just let us work modularly, it gives us some cool tools to do it:

  • Ref() Function: This is how one block knows about another block, so everything fits together nicely.
  • Packages: These are collections of blocks that we can use over and over again in different projects.
  • Tests: These help us make sure each block is strong and fits just right.

Read our blog post on DBT models to learn more.

Wrapping Up

Making your data models one by one might feel like more work at first, but it’s a smart move. It keeps things flexible and sturdy. Each little model is a step towards a big, awesome data setup that helps people make smart choices. When you go modular with dbt, you’re not just building a model; you’re building a super cool, changeable, and strong data world.

So, there you have it. Modularity in dbt is all about making your data work easier, clearer, and better for everyone. If you want to know more, learn how to get started with dbt Cloud. Happy building!

See also

  • Darko Monzio Compagnoni

    Before becoming an analytics engineer, I worked in marketing, communications, customer support, and hospitality. I noticed how each of these fields, in their own way, benefit from decisions backed by data. Which fields don’t, after all? After spotting this pattern, I decided to retrain as a self taught data analyst, to then complete the Nimbus Intelligence Academy program and graduating as an Analytics Engineer obtaining certifications in Snowflake, dbt, and Alteryx. I'm now equipped to bring my unique perspective to any data driven team.

Darko Monzio Compagnoni

Before becoming an analytics engineer, I worked in marketing, communications, customer support, and hospitality. I noticed how each of these fields, in their own way, benefit from decisions backed by data. Which fields don’t, after all? After spotting this pattern, I decided to retrain as a self taught data analyst, to then complete the Nimbus Intelligence Academy program and graduating as an Analytics Engineer obtaining certifications in Snowflake, dbt, and Alteryx. I'm now equipped to bring my unique perspective to any data driven team.

Leave a Reply