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.

Folder responsibilities
| Folder | Contents | Rules |
|---|---|---|
| models/staging | One model per source table, grouped by source system | Select from sources only, light cleaning, no joins |
| models/intermediate | Reusable reshaping and joining steps | Not exposed to BI tools |
| models/marts | Business entities and facts, grouped by domain | Tested, documented and owned |
| macros | Reusable Jinja functions | Small and documented |
| seeds | Small CSV reference data | No sensitive data |
| snapshots | History capture of changing tables | Protected schema |
| tests | Custom singular tests | Clear names and purpose |
Keep dependencies flowing in one direction: staging into intermediate into marts.
Naming conventions
| Object | Convention | Example |
|---|---|---|
| Staging models | stg_ plus source and table | stg_shop__orders |
| Intermediate models | int_ plus purpose | int_orders_joined_payments |
| Dimensions | dim_ plus entity | dim_customers |
| Facts | fct_ plus event | fct_orders |
| YAML files | Named by folder and purpose | _shop__sources.yml |
| Columns | Snake case with consistent suffixes | created_at, order_id |
Write the conventions down and enforce them in review or automated checks.

Project configuration
- Set folder defaults. Define materializations and schemas per folder in the project file.
- Use tags and meta. Tag domains and owners for selection and reporting.
- Define environments. Use targets for development, CI and production.
- Control access. Apply grants and access settings by layer.
- Add contracts. Enforce shapes on public marts.
- 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.
Related guides
Read dbt documentation, macros and Jinja, data mesh and data marts for related topics.
Structure checklist
| Item | Done when |
|---|---|
| Layers | Staging, intermediate and marts defined |
| Names | Prefixes agreed and enforced |
| Config | Defaults set per folder |
| Owners | Every mart has an owner |
| Checks | Conventions automated in CI |
| Docs | README 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
| Term | Meaning |
|---|---|
| Staging | Clean models over raw sources |
| Intermediate | Reusable reshaping step |
| Mart | Business-facing model |
| Public model | Model safe for others to use |
| Target | Environment 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.
