Metacenta

Lineage integrity · rule fan-out-hotspot

dbt models with too many direct dependents

A Metacenta review checks this under the rule No model is a single point of failure. Everything below applies whether or not you ever commission one.

What this rule checks

This rule flags any dbt model that more than 15 other models read directly through ref(). Only direct dependents count. Exposures, tests and indirect descendants do not, and sources are not judged here.

Why it matters

One defect in the model reaches every dependent at once. Any change to its columns is effectively a breaking change for all of them.

How to fix it

Treat the high-fan-out models as contracted interfaces. Treat the model as a contracted interface. Enforce a contract on its columns, and assert its grain with unique and not_null tests before anything else.

Before:

models:
  - name: dim_customers
    columns:
      - name: customer_id

After:

models:
  - name: dim_customers
    config:
      contract:
        enforced: true
    columns:
      - name: customer_id
        data_type: int
        data_tests:
          - unique
          - not_null

When it is fine to leave

A shared dimension such as dim_customers, or a calendar table, is meant to be read widely. The finding is informational: it names where a defect would spread furthest. Keep the fan-out, and protect the model with a contract and tests.

What we need to check it

manifest.json alone. Each finding states how many models depend on it directly. The threshold is a review setting, 15 by default.

Published rules it corresponds to

dbt_project_evaluator, rule fct_model_fanout. Ours checks the same concern, tested differently. dbt Labs' rule counts direct leaf children over a default of 3; this one counts direct dependents of any kind, so the two flag overlapping but different sets.

This means our check corresponds to their rule. It does not mean the publisher reviewed or endorses it.