diff --git a/website/blog/2024-01-09-defer-in-development.md b/website/blog/2024-01-09-defer-in-development.md index 4ff48d7d2e0..634fd1100c9 100644 --- a/website/blog/2024-01-09-defer-in-development.md +++ b/website/blog/2024-01-09-defer-in-development.md @@ -16,7 +16,7 @@ Picture this — you’ve got a massive dbt project, thousands of models chuggin “OK,” you think further, “I’ll just run a `dbt build -s +my_changed_model` to make sure I have everything I need built into my dev schema and I can test my changes”. You run the command. You wait. You wait some more. You get some coffee, and completely take yourself out of your dbt development flow state. A lot of time and money down the drain to get to a point where you can *start* your work. That’s no good! -Luckily, dbt’s defer functionality allow you to *only* build what you care about when you need it, and nothing more. This feature (which has been around for a long time!) helps developers spend less time and money in development, helping ship trusted data products faster. dbt Cloud now offers native support for this workflow in development, so it’s never been easier to master the defer feature in dbt! +Luckily, dbt’s defer functionality allow you to *only* build what you care about when you need it, and nothing more. This feature helps developers spend less time and money in development, helping ship trusted data products faster. dbt Cloud offers native support for this workflow in development, so you can start deferring without any additional overhead! ## Defer to prod or prefer to slog @@ -58,15 +58,15 @@ Let’s think back to the hypothetical above — what if we made use of the Let’s take a look at a simplified example — let’s say your project looks like this in production: - + And you’re tasked with making changes to `model_f`. Without defer, you would need to make sure to at minimum execute a `dbt run -s +model_f` to ensure all the upstream dependencies of `model_f` are present in your development schema so that you can start to run `model_f`.* You just spent a whole bunch of time and money duplicating your models, and now your warehouse looks like this: - + With defer, we should not build anything other than the models that have changed, and are now different from their production counterparts! Let’s tell dbt to use production metadata to resolve our refs, and only build the model I have changed — that command would be `dbt run -s model_f --defer` .** - + This results in a *much slimmer build* — we read data in directly from the production version of `model_b` and `model_c`, and don’t have to worry about building anything other than what we selected! @@ -76,11 +76,11 @@ This results in a *much slimmer build* — we read data in directly from the ### Batteries included deferral in dbt Cloud -dbt Cloud offers a seamless deferral experience in both the dbt Cloud IDE and the dbt Cloud CLI — dbt Cloud ***always*** has the latest run artifacts from your production environment. Rather than having to go through the painful process of somehow getting a copy of your latest production `manifest.json` into your local filesystem to defer to, and building a pipeline to alaways keep it fresh, dbt Cloud does all that work for you. When developing in dbt Cloud, the latest artifact is automatically provided to you under the hood, and dbt Cloud handles the `--defer` flag for you when you run commands in “defer mode”. dbt Cloud will use the artifacts from the deployment environment in your project marked as `Production` in the [environments settings](https://docs.getdbt.com/docs/deploy/deploy-environments#set-as-production-environment) in both the IDE and the Cloud CLI. Be sure to configure a production environment to unlock this feature! +dbt Cloud offers a seamless deferral experience in both the dbt Cloud IDE and the dbt Cloud CLI — dbt Cloud ***always*** has the latest run artifacts from your production environment. Rather than having to go through the painful process of somehow getting a copy of your latest production `manifest.json` into your local filesystem to defer to, and building a pipeline to always keep it fresh, dbt Cloud does all that work for you. When developing in dbt Cloud, the latest artifact is automatically provided to you under the hood, and dbt Cloud handles the `--defer` flag for you when you run commands in “defer mode”. dbt Cloud will use the artifacts from the deployment environment in your project marked as `Production` in the [environments settings](https://docs.getdbt.com/docs/deploy/deploy-environments#set-as-production-environment) in both the IDE and the Cloud CLI. Be sure to configure a production environment to unlock this feature! In the dbt Cloud IDE, there’s as simple toggle switch labeled `Defer to production`. Simply enabling this toggle will defer your command to the production environment when you run any dbt command in the IDE! - + The cloud CLI has this setting *on by default* — there’s nothing else you need to do to set this up! If you prefer not to defer, you can pass the `--no-defer` flag to override this behavior. You can also set an environment other than your production environment as the deferred to environment in your `dbt-cloud` settings in your `dbt_project.yml` : @@ -100,13 +100,13 @@ One of the major gotchas in the defer workflow is that when you’re in defer mo Let’s take a look at that example above again, and pretend that some time before we went to make this edit, we did some work on `model_c`, and we have a local copy of `model_c` hanging out in our development schema: - + When you run `dbt run -s model_f --defer` , dbt will detect the development copy of `model_c` and say “Hey, y’know, I bet Dave is working on that model too, and he probably wants to make sure his changes to `model_c` work together with his changes to `model_f` . Because I am a kind and benevolent data transformation tool, i’ll make sure his `{{ ref('model_c') }]` function compiles to his development changes!” Thanks dbt! As a result, we’ll effectively see this behavior when we run our command: - + Where our code would compile from @@ -155,6 +155,6 @@ While defer is a faster and cheaper option for most folks in most situations, de ### Call me Willem Defer - + Defer to prod is a powerful way to improve your development velocity with dbt, and dbt Cloud makes it easier than ever to make use of this feature! You too could look this cool while you’re saving time and money developing on your dbt projects! diff --git a/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-full.png b/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-full.png deleted file mode 100644 index 45a1119cd96..00000000000 Binary files a/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-full.png and /dev/null differ diff --git a/website/static/img/blog/2023-12-04-defer-in-development/defer-toggle.png b/website/static/img/blog/2024-01-09-defer-in-development/defer-toggle.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/defer-toggle.png rename to website/static/img/blog/2024-01-09-defer-in-development/defer-toggle.png diff --git a/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-defer.png b/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-defer.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-defer.png rename to website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-defer.png diff --git a/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-full.png b/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-full.png new file mode 100644 index 00000000000..4381a13abed Binary files /dev/null and b/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-full.png differ diff --git a/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-mixed.png b/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-mixed.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-mixed.png rename to website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-mixed.png diff --git a/website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-model-c.png b/website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-model-c.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/prod-and-dev-model-c.png rename to website/static/img/blog/2024-01-09-defer-in-development/prod-and-dev-model-c.png diff --git a/website/static/img/blog/2023-12-04-defer-in-development/prod-environment-plain.png b/website/static/img/blog/2024-01-09-defer-in-development/prod-environment-plain.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/prod-environment-plain.png rename to website/static/img/blog/2024-01-09-defer-in-development/prod-environment-plain.png diff --git a/website/static/img/blog/2023-12-04-defer-in-development/willem.png b/website/static/img/blog/2024-01-09-defer-in-development/willem.png similarity index 100% rename from website/static/img/blog/2023-12-04-defer-in-development/willem.png rename to website/static/img/blog/2024-01-09-defer-in-development/willem.png