Skip to main content

About environments

In software engineering, environments are used to enable engineers to develop and test code without impacting the users of their software. Typically, there are two types of environments in dbt:

  • Deployment or Production (or prod) — Refers to the environment that end users interact with.

  • Development (or dev) — Refers to the environment that engineers work in. This means that engineers can work iteratively when writing and testing new code in development. Once they are confident in these changes, they can deploy their code to production.

In traditional software engineering, different environments often use completely separate architecture. For example, the dev and prod versions of a website may use different servers and databases. Data warehouses can also be designed to have separate environments — the production environment refers to the relations (for example, schemas, tables, and views) that your end users query (often through a BI tool).

Environment separation

There are several common approaches to isolating environments in a data warehouse:

ApproachHowWhen to use
Separate schemas (recommended)Each environment writes to a different schema in the same databaseWorks for most teams; lowest cost and easiest to set up
Separate databasesEach environment targets a different database.Useful when schema-level access controls are insufficient.
Separate accounts or clustersEach environment connects to a completely different warehouse account or cluster.Needed for strict network or compliance isolation between environments.
Loading table...

We recommend using separate schemas per developer as the default approach. The pattern dbt_<username> for dev schemas ensures each developer has an isolated space without overwriting each other's work.

Configure environments to tell dbt or dbt Core how to build and execute your project in development and production:


Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0