Sub topic 10
Development mode versus production mode
This chapter assumes you can create a pipeline with source files, a target catalog and schema, and compute, and that you know the difference between triggered and continuous updates. If any of that is unfamiliar, review the earlier chapters on the pipeline object and update modes first.
Why two modes exist
A pipeline update starts compute, resolves the dependency graph, and runs every flow. While you write code, you will hit errors often: a typo in a column name, a missing table, a bad path. Production needs the opposite behavior. A transient failure, such as a node that fails to start, should be retried so that the data stays fresh without anyone watching.
Development mode and production mode adjust compute reuse and retry behavior to fit each situation. They do not change your SQL or Python code, and they do not change which datasets get created.
What changes between the modes
| Behavior | Development mode | Production mode |
|---|---|---|
| Compute after an update ends | Stays running for reuse, so the next update starts faster | Shuts down when the update finishes |
| Retries on failure | Disabled, so errors appear immediately | Enabled, with the pipeline retrying the update on failures such as a cluster start problem |
| Intended use | Interactive editing and testing | Scheduled or continuous runs |
Exact retry counts and timeouts can differ between releases and compute types, so check the current Databricks documentation before relying on specific numbers. Serverless pipelines manage compute for you, so the compute-reuse difference matters most when you use classic compute.
Switching modes
In the pipeline editor, the mode is a toggle next to the Start button. You can change it at any time, and the new setting applies to the next update.
When a pipeline is defined as code, the mode is a setting on the pipeline. In a Databricks Asset Bundle, you set development on the pipeline resource:
resources:
pipelines:
orders_pipeline:
name: orders_pipeline
catalog: main
schema: demo
serverless: true
continuous: false
development: true
libraries:
- file:
path: ../src/orders.sqlSetting development: false gives production behavior. Bundles also have their own mode: development and mode: production for deployment targets. The bundle target mode can set the pipeline's development flag for you, for example by turning it on for development targets. Keep the two ideas separate: one is a bundle deployment setting, the other is a pipeline runtime setting.
A typical workflow
- Build and test the pipeline in development mode, using a development schema so test output does not mix with real tables.
- Fix errors quickly, since a failed update does not retry and the error shows immediately.
- Switch to production mode when the logic is stable.
- Attach a schedule, such as a job that triggers the pipeline, or use continuous mode if you need low latency.
Common mistakes
- Leaving a production pipeline in development mode. Failures are not retried, and classic compute may stay up and keep billing after an update. A scheduled run can fail for a brief, recoverable reason.
- Treating the mode as a data isolation tool. The mode does not write to a different schema. If dev and prod pipelines share the same target catalog and schema, they will write to the same tables. Use separate schemas or catalogs.
- Expecting retries to fix logic errors. Production retries target infrastructure problems. A broken query fails again on every attempt.
Exercise
A scheduled pipeline occasionally fails overnight because a cluster does not start, and nobody retries it. Which mode setting is the likely cause, and what should you change?
Show answer
The pipeline is probably in development mode, which disables automatic retries. Switch it to production mode (development: false in the bundle) so transient failures are retried and compute shuts down after each update.