"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[23807],{55214:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>c,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(74848),i=t(28453);const r={title:"Why you should specify a production environment in dbt Cloud",description:"The bottom line: You should split your Environments in dbt Cloud based on their purposes (e.g. Production and Staging/CI) and mark one environment as Production. This will improve your CI experience and enable you to use dbt Explorer.",slug:"specify-prod-environment",authors:["joel_labes"],tags:["dbt Cloud"],hide_table_of_contents:!1,date:new Date("2023-11-14T00:00:00.000Z"),is_featured:!1},s=void 0,a={permalink:"/blog/specify-prod-environment",source:"@site/blog/2023-11-14-specify-prod-environment.md",title:"Why you should specify a production environment in dbt Cloud",description:"The bottom line: You should split your Environments in dbt Cloud based on their purposes (e.g. Production and Staging/CI) and mark one environment as Production. This will improve your CI experience and enable you to use dbt Explorer.",date:"2023-11-14T00:00:00.000Z",tags:[{inline:!0,label:"dbt Cloud",permalink:"/blog/tags/dbt-cloud"}],readingTime:4.505,hasTruncateMarker:!0,authors:[{job_title:"Senior Developer Experience Advocate",links:[{icon:"fa-linkedin",url:"https://www.linkedin.com/in/joel-labes/"},{icon:"fa-twitter",url:"https://twitter.com/joellabes"}],name:"Joel Labes",organization:"dbt Labs",imageURL:"/img/blog/authors/jlabes.png",key:"joel_labes"}],frontMatter:{title:"Why you should specify a production environment in dbt Cloud",description:"The bottom line: You should split your Environments in dbt Cloud based on their purposes (e.g. Production and Staging/CI) and mark one environment as Production. This will improve your CI experience and enable you to use dbt Explorer.",slug:"specify-prod-environment",authors:["joel_labes"],tags:["dbt Cloud"],hide_table_of_contents:!1,date:"2023-11-14T00:00:00.000Z",is_featured:!1},unlisted:!1,prevItem:{title:"How we built consistent product launch metrics with the dbt Semantic Layer",permalink:"/blog/product-analytics-pipeline-with-dbt-semantic-layer"},nextItem:{title:"To defer or to clone, that is the question",permalink:"/blog/to-defer-or-to-clone"}},d={authorsImageUrls:[void 0]},l=[];function u(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{title:"You can now use a Staging environment!",type:"note",children:(0,o.jsxs)(n.p,{children:["This blog post was written before Staging environments. You can now use dbt Cloud can to support the patterns discussed here. Read more about ",(0,o.jsx)(n.a,{href:"/docs/deploy/deploy-environments#staging-environment",children:"Staging environments"}),"."]})}),"\n",(0,o.jsx)(n.admonition,{title:"The Bottom Line:",type:"tip",children:(0,o.jsxs)(n.p,{children:["You should ",(0,o.jsx)(n.a,{href:"#how",children:"split your Jobs"})," across Environments in dbt Cloud based on their purposes (e.g. Production and Staging/CI) and set one environment as Production. This will improve your CI experience and enable you to use dbt Explorer."]})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"/docs/environments-in-dbt",children:"Environmental segmentation"})," has always been an important part of the analytics engineering workflow:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["When developing new models you can ",(0,o.jsx)(n.a,{href:"/reference/dbt-jinja-functions/target#use-targetname-to-limit-data-in-dev",children:"process a smaller subset of your data"})," by using ",(0,o.jsx)(n.code,{children:"target.name"})," or an environment variable."]}),"\n",(0,o.jsxs)(n.li,{children:["By building your production-grade models into ",(0,o.jsx)(n.a,{href:"https://docs.getdbt.com/docs/build/custom-schemas#managing-environments",children:"a different schema and database"}),", you can experiment in peace without being worried that your changes will accidentally impact downstream users."]}),"\n",(0,o.jsx)(n.li,{children:"Using dedicated credentials for production runs, instead of an analytics engineer's individual dev credentials, ensures that things don't break when that long-tenured employee finally hangs up their IDE."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Historically, dbt Cloud required a separate environment for ",(0,o.jsx)(n.em,{children:"Development"}),", but was otherwise unopinionated in how you configured your account. This mostly just worked \u2013 as long as you didn't have anything more complex than a CI job mixed in with a couple of production jobs \u2013 because important constructs like deferral in CI and documentation were only ever tied to a single job."]}),"\n",(0,o.jsxs)(n.p,{children:["But as companies' dbt deployments have grown more complex, it doesn't make sense to assume that a single job is enough anymore. We need to exchange a job-oriented strategy for a more mature and scalable environment-centric view of the world. To support this, a recent change in dbt Cloud enables project administrators to ",(0,o.jsx)(n.a,{href:"/docs/deploy/deploy-environments#set-as-production-environment-beta",children:"mark one of their environments as the Production environment"}),", just as has long been possible for the Development environment."]}),"\n",(0,o.jsx)(n.p,{children:"Explicitly separating your Production workloads lets dbt Cloud be smarter with the metadata it creates, and is particularly important for two new features: dbt Explorer and the revised CI workflows."})]})}function c(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},28453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(96540);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);