DBT-ANALYTICS-ENGINEERING practice question 11 of 35

True or False: Creating separate models for each transformation step is an effective way to apply modularity and DRY principles in a dbt project.

Full set: 409 questions

Domain Modeling

Answer options
A: TRUE
B: FALSE
Correct Answer:
TRUE
Explanation

This statement is true. Breaking down complex data transformations into a series of smaller, discrete models is a core tenet of dbt development and a direct application of software engineering best practices. Each model represents a logical step in the transformation process. This approach enhances modularity, as each model becomes a self-contained, understandable, and testable unit. It also promotes the DRY (Don't Repeat Yourself) principle, because a common transformation (e.g., cleaning a specific data source, calculating a business-specific metric) can be built once in an intermediate model and then referenced (ref) by multiple downstream models, eliminating the need to rewrite the same logic. This results in a more maintainable, scalable, and debuggable dbt project.

Why Incorrect

This is a True/False question, so there is no incorrect option to evaluate. The statement accurately reflects dbt best practices.

References

1. dbt Labs Documentation, "Best practice guides: Refactoring: modularity": "Break down complex models into smaller pieces, and ref them. This makes your project: easier to understand... easier to debug... more reusable (DRY)." This source directly confirms that creating smaller, separate models is the prescribed method for achieving modularity and reusability (DRY).

2. dbt Labs Documentation, "How we structure our dbt projects: Intermediate models": "The goal of the intermediate layer is to take our source-conformed data and transform it in a way that is either: specific to our business logic... or useful for many marts... By materializing these transformations as their own models, we can test them, and we don't have to repeat the code in every mart that needs it." This section explicitly details the practice of creating separate models for transformation steps to avoid repetition (DRY) and improve project structure.

3. dbt Labs Documentation, "What is dbt?: How dbt works": The documentation explains the Directed Acyclic Graph (DAG), which is built from the ref functions linking models. It states, "dbt builds a dependency graph of all of your models ("the DAG"), and runs them in the correct order." This fundamental architecture of dbt is designed to support and encourage the creation of many small, interdependent models, which is the essence of modularity.

Scroll to Top