English · IndiaLog in
Rackwave Technologies
Request quote Free consultation
DataUpdated 26 Nov 2026

dbt Project Structure: Layers, Naming and Scaling

dbt project structure: layers, naming, configuration and scaling.

Written by Rohan Verma
  • Published25 Nov 2026
  • Read time6 min
  • Length1,292 words
Share this guide

What is a good dbt project structure? A dbt project structure is the way you organise folders, models, tests, macros and configuration so that a growing analytics codebase stays readable, consistent and safe to change. The usual pattern is layered folders for staging, intermediate and marts models, grouped by source system or business domain, with shared configuration, naming rules and ownership defined in YAML. A clear structure helps new team members find things, keeps lineage understandable, limits the blast radius of changes and makes cost and access control easier to manage. This guide explains the standard layout, naming conventions, configuration, how to scale to many teams, how to enforce rules and the mistakes that turn a project into a tangle. Details vary by version, so confirm in current dbt documentation.

Short answer: Organise models by layer and then by source or domain, use consistent prefixes, set defaults in the project file, assign owners and enforce conventions with automated checks. Split into several projects only when team boundaries truly require it.

The standard layout

A typical project has a models folder divided into staging, intermediate and marts, plus folders for macros, seeds, snapshots, tests and analyses. Each layer has a clear job and rules about what may depend on what. See dbt models and getting started with dbt.

dbt project structure diagram
Figure 1. dbt project structure: sources, staging, intermediate and how they relate.

Folder responsibilities

FolderContentsRules
models/stagingOne model per source table, grouped by source systemSelect from sources only, light cleaning, no joins
models/intermediateReusable reshaping and joining stepsNot exposed to BI tools
models/martsBusiness entities and facts, grouped by domainTested, documented and owned
macrosReusable Jinja functionsSmall and documented
seedsSmall CSV reference dataNo sensitive data
snapshotsHistory capture of changing tablesProtected schema
testsCustom singular testsClear names and purpose

Keep dependencies flowing in one direction: staging into intermediate into marts.

Naming conventions

ObjectConventionExample
Staging modelsstg_ plus source and tablestg_shop__orders
Intermediate modelsint_ plus purposeint_orders_joined_payments
Dimensionsdim_ plus entitydim_customers
Factsfct_ plus eventfct_orders
YAML filesNamed by folder and purpose_shop__sources.yml
ColumnsSnake case with consistent suffixescreated_at, order_id

Write the conventions down and enforce them in review or automated checks.

Structure at a glance summary
Figure 2. Structure at a glance: layers, names, config at a glance.

Project configuration

  1. Set folder defaults. Define materializations and schemas per folder in the project file.
  2. Use tags and meta. Tag domains and owners for selection and reporting.
  3. Define environments. Use targets for development, CI and production.
  4. Control access. Apply grants and access settings by layer.
  5. Add contracts. Enforce shapes on public marts.
  6. Document the layout. Keep a README describing structure and rules.

Scaling to many teams

  • Group marts by business domain, with an owner for each folder.
  • Use model access settings to mark public interfaces and keep internals private.
  • Version public models when making breaking changes.
  • Consider several projects when teams need independent release cycles.
  • Share packages for common macros and tests.
  • Use a central platform team to maintain standards and tooling.

Enforcing conventions

Conventions fail when they depend on memory. Add checks in continuous integration that verify naming, require descriptions and owners on marts, block cross-layer dependencies, such as marts reading raw sources and flag models without tests. Linting SQL and YAML keeps formatting consistent, and a short pull request template reminds authors what reviewers look for.

  • Automated naming and dependency checks.
  • Coverage requirements for tests and docs.
  • SQL and YAML linting.
  • Pull request templates.

Handling shared logic across domains

As domains multiply, shared logic such as calendars, currency conversion and customer identity tends to appear in several places. Put these in a clearly owned shared area of the project, expose them as public models with contracts and let domain marts depend on them. Avoid copying logic between domains, because the copies will drift and produce conflicting numbers.

Agree how teams request changes to shared models. A short process with an owner, a review step and a release note keeps shared assets stable while still letting them evolve. See model contracts for how to protect interfaces.

  • Create an owned shared area.
  • Expose shared models with contracts.
  • Avoid copying logic.
  • Define a change request process.

Cost and performance by structure

Folder structure can control cost. Set cheap view materialization for staging, tables for marts and incremental builds for large facts, all as folder defaults. Tag expensive domains and report run cost per tag, so teams see the effect of their changes. Use selective builds in development and CI so engineers do not rebuild the whole project for a small edit.

  • Defaults by folder.
  • Cost reports by tag.
  • Selective builds in CI.

Migrating an existing project to a better structure

Reorganising a large project can be done safely in small steps. First agree the target layout and conventions, then move one domain at a time, renaming models with aliases so that downstream consumers keep working. Compare outputs before and after each move and update documentation in the same pull request. Deprecate old names with a date and remove them when lineage shows no remaining use.

Reviewing structure regularly

Set a recurring review of folder layout, naming and dependency rules, ideally every six months, and record decisions in the project README.

  • Review layout twice a year.
  • Record decisions in the README.

Common mistakes

  • Flat folders with hundreds of models.
  • Marts that read raw sources directly.
  • Inconsistent names that make lineage hard to read.
  • No owners for marts.
  • Splitting into many projects too early.
  • Unwritten conventions that only some people know.

A worked example

A growing team reorganised a flat folder of two hundred models into staging by source, intermediate by purpose and marts by domain. They added naming checks, owners in metadata and a rule that marts could not read raw sources.

New analysts found models faster, review comments about style fell and the team could see which domain drove run cost. The example is illustrative.

Best practices and support

  • Keep the structure simple until size demands more.
  • Write down and automate conventions.
  • Review the layout every six months.
  • Align folders with team ownership.

Our data analytics service and data warehousing service design dbt project structures that scale with the team.

Read dbt documentation, macros and Jinja, data mesh and data marts for related topics.

Structure checklist

ItemDone when
LayersStaging, intermediate and marts defined
NamesPrefixes agreed and enforced
ConfigDefaults set per folder
OwnersEvery mart has an owner
ChecksConventions automated in CI
DocsREADME explains the layout

One project or many

A single project is easiest to run and understand, with one lineage graph and one build. Multiple projects help when teams need independent releases, separate access or different ownership, but add coordination cost. If you split, use public models with contracts as the interface between projects, so teams can change internals without breaking each other. Start with one project and split only for a clear reason.

  • Start with a single project.
  • Split for independent releases or access.
  • Use public models and contracts between projects.
  • Keep shared packages for common code.

Environments and schemas

Use separate schemas for development, CI and production so work never collides. Name them with the environment and developer or pull request identifier, and clean up temporary schemas automatically. Production schemas should be written only by the production job, with read access granted by layer. See data governance.

Key takeaways

  • Use staging, intermediate and marts.
  • Name consistently.
  • Set defaults in project config.
  • Assign owners.
  • Automate convention checks.

Quick glossary

TermMeaning
StagingClean models over raw sources
IntermediateReusable reshaping step
MartBusiness-facing model
Public modelModel safe for others to use
TargetEnvironment configuration

Read next: BigQuery vs Snowflake: Which Cloud Data Platform? · BigQuery Streaming Inserts: Real-Time Ingestion Guide · BigQuery Access Control: IAM, Policy Tags and Row Security

Frequently asked questions

What is the standard dbt project structure?

Models grouped into staging, intermediate and marts, with folders for macros, seeds, snapshots and tests.

How should I name dbt models?

Use prefixes such as stg_, int_, dim_ and fct_ with consistent source and entity names.

Should marts read raw sources?

No. Marts should read staging or intermediate models so source changes stay isolated.

How do I organise models for many teams?

Group marts by domain, assign owners and use public models with contracts as interfaces.

When should I split into multiple projects?

When teams need independent releases, access boundaries or ownership, and not before.

How do I enforce conventions?

Automate naming, dependency, test and documentation checks in continuous integration.

Where do project defaults go?

In the project configuration file, set per folder for materialization and schema.

How do environments stay separate?

Use different schemas and credentials for development, CI and production targets.

Was this guide helpful?Your answer helps us decide what to improve. It is not linked to you.

#dbt project structure#dbt folder structure#dbt naming conventions#dbt best practices#dbt project layout

About the author

Rohan Verma

Data Platforms Consultant

Rohan works across CDP, data warehouse, and analytics platform implementations, helping clients figure out which data infrastructure actually fits their scale rather than defaulting to whatever's currently trending.

Data Platforms & Technical Architecture

Ready to put AI and data to work?

Book a free consultation and leave with a plan, not a pitch.

Get a free consultationRequest quote