# Dbt dev/prod data pipelines

**URL:** <https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812>\
**Category:** In-Depth Discussions\
**Tags:** data-quality, best-practice, environments, adopting-dbt\
**Created:** [August 24, 2022, 3:53pm UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812 "2022-08-24T15:53:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lawwu](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@lawwu](https://discourse.getdbt.com/u/lawwu)\
**Post date:** [August 24, 2022, 3:53pm UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/1 "2022-08-24T15:53:53Z")

</div>

Hello,

First time adopter of dbt in the last couple months. I had a question around best practices in handling dbt runs for dev and prod. I’d like to:

1. Have a daily job that runs `dbt run` to target a dev schema
2. Run `dbt test` to make sure all the unit tests pass
3. Run `dbt run --target prod`

A couple of questions:

- Is this order of operations typical?
- We’re using big query. Is it possible to have the the dev target in one GCP “dev” project and the prod target in a GCP “prod” project?

---

<div class="post-metadata">

**Author:** ![pcreux](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/pcreux/32/712_2.png) [@pcreux](https://discourse.getdbt.com/u/pcreux)\
**Post date:** [August 26, 2022, 10:00am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/2 "2022-08-26T10:00:57Z")

</div>

Hello there,

You can definitely target two different GCP projects.

Ex:

```auto
# profiles.yml
templates:
  bigquery: &bigquery
    # run the following command to authenticate:
    # $> gcloud auth application-default login --scopes=https://www.googleapis.com/auth/bigquery
    dbname: analytics
    type: bigquery
    method: oauth
    threads: 10
    timeout_seconds: 300
    priority: interactive
    retries: 1

default:
  outputs:
    dev:
      <<: *bigquery
      project: acme-dev
    prod:
      <<: *bigquery
      project: acme-prod
  target: dev

```

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [September 23, 2022, 3:52am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/3 "2022-09-23T03:52:28Z")

</div>

> [@pcreux](#):
>
> ```auto
> <<: *bigquery
> 
> ```

@pcreux I haven’t seen this `<<:` syntax before - does this let you take all of the contents of an anchor and then append extra keys? That’s very exciting because it has always annoyed me that I couldn’t make that work!

---

<div class="post-metadata">

**Author:** ![pcreux](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/pcreux/32/712_2.png) [@pcreux](https://discourse.getdbt.com/u/pcreux)\
**Post date:** [September 27, 2022, 9:18am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/4 "2022-09-27T09:18:43Z")

</div>

@joellabes Yes! You’re totally right!

---

<div class="post-metadata">

**Author:** ![obar1](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/obar1/32/1221_2.png) [@obar1](https://discourse.getdbt.com/u/obar1)\
**Post date:** [October 16, 2022, 8:34am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/5 "2022-10-16T08:34:42Z")

</div>

Watch this then 😀 [YAML Basics: Anchors and Aliases - YouTube](https://www.youtube.com/watch?v=2cxBftrVc2Y&t=247)

---

<div class="post-metadata">

**Author:** ![emiliobiz98](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@emiliobiz98](https://discourse.getdbt.com/u/emiliobiz98)\
**Post date:** [November 28, 2023, 9:13am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/6 "2023-11-28T09:13:40Z")

</div>

Super interesting. How does that translate to dbt cloud? @pcreux

I currently want to run my production jobs to another gcp project called ‘production’ but when I insert production in the target dbt jobs simply don’t work … any clue on how to approach this?

---

<div class="post-metadata">

**Author:** ![pcreux](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/pcreux/32/712_2.png) [@pcreux](https://discourse.getdbt.com/u/pcreux)\
**Post date:** [November 28, 2023, 9:28am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/7 "2023-11-28T09:28:28Z")

</div>

@emiliobiz98 I’m not familiar with dbt cloud, unfortunately.

---

<div class="post-metadata">

**Author:** ![emiliobiz98](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@emiliobiz98](https://discourse.getdbt.com/u/emiliobiz98)\
**Post date:** [November 28, 2023, 9:29am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/8 "2023-11-28T09:29:58Z")

</div>

No worries, I appreciate the fast answer. Any chance @joellabes? 👀

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [January 16, 2024, 12:35am UTC](https://discourse.getdbt.com/t/dbt-dev-prod-data-pipelines/4812/9 "2024-01-16T00:35:01Z")

</div>

You can use [Extended Attributes](https://docs.getdbt.com/docs/dbt-cloud-environments#extended-attributes) to add things that are configurable in profiles.yml but which dbt Cloud doesn’t expose directly.

They’re not compatible with yaml anchors etc as it’s just a dumb textbox, but it should work for your use case
