Skip to main content
Uncategorized

Understanding modularity

By november 10, 2023maart 5th, 2024No Comments

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

Auteur

Leave a Reply