📘Introduction

In this hands-on dbt tutorial, you’ll learn how to configure separate development (DEV) and production (PROD) environments to safely build, test, and deploy your data models. We’ll walk through why environment separation matters and how to configure your profiles.yml so you can switch between environments with ease.

🎓 Preparing for dbt Analytics Engineering Certification?
Check out our exam study guide packed with practical examples and hands-on tutorials:

➡️📕 dbt Analytics Engineering Certification Guide

💡Options for Setting Up Dev and Prod environments

There are several ways to separate development (DEV) and production (PROD) environments in dbt. The goal is to ensure that changes can be safely developed and tested before being deployed to production.

🏠 Option 1: Multiple Warehouses

In this approach, you maintain separate databases for each environment - one database for dev and another for prod.

  • ✅ Pros: Complete isolation between environments — changes in DEV can never affect PROD.
  • ⚠️ Cons: More setup and maintenance overhead since you need multiple connections and configurations.

🗂️ Option 2: One Warehouse with multiple schemas

In this approach, you use a single database but separate schemas (e.g., dev and prod) to distinguish between environments.

  • ✅ Pros: Simpler setup and potentially lower cost — both environments share the same warehouse connection.
  • ⚠️ Cons: Risk of cross-environment interference if permissions are not well managed.

⚙️ Configure environments in profiles.yml

Let’s set up Option 1 (Multiple Warehouses). So we configure one database for 🔵 DEV‚ and one for 🟡 PROD.

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In