Hello! Welcome to your next lesson on building production pipelines with Delta Live Tables.
In our last lesson, we focused on ensuring data integrity by applying expectations to our DLT tables. You learned how to define data quality rules and specify actions—Warn, Drop, or Fail—to handle records that violate them. We established what the pipeline should do and the quality standards it must meet.
Now, we'll address a different but equally important question: when should the pipeline run? The answer depends on a fundamental trade-off between data freshness and computational cost. By the end of this lesson, you will be able to differentiate between triggered and continuous pipeline execution modes, a key skill for designing efficient and cost-effective data pipelines.
Execution Modes: The Core of Pipeline Scheduling
In Delta Live Tables, the execution mode determines the lifecycle of the compute resources (the cluster) and how often your data is processed. You have two primary choices: Triggered and Continuous.
Let's start with a clear, high-level definition of each mode from an article written to help learners like you prepare for the certification exam.
Understanding Execution Modes in Databricks DLT Pipelines
This article provides an excellent summary that gets straight to the point. It's framed around a sample exam question, which makes it particularly relevant for your goal.
Please read the section titled 'Execution Modes: Continuous vs. Triggered'. It provides a direct, side-by-side comparison of the two modes.
As you just read, the choice is fundamentally about whether the pipeline runs constantly or in discrete batches. Let's formalize this.
-
Continuous Mode: The pipeline runs constantly. The cluster stays active to process new data as soon as it arrives from the source. This is ideal for streaming use cases where low-latency, near-real-time data is a priority.
-
Triggered Mode: The pipeline starts a cluster, processes all data available at that moment, and then terminates the cluster once the update is complete. This is best for batch workloads where data freshness is less critical (e.g., hourly or daily updates).
The Fundamental Trade-Off: Cost vs. Latency
The decision between triggered and continuous execution boils down to balancing business needs with resource costs. The official Databricks documentation provides a detailed comparison that is essential for understanding this trade-off.
Triggered vs. continuous pipeline mode
Let's dive deeper with the official documentation. It includes a very useful table that summarizes the practical differences between the two modes.
Please read the sections 'What is triggered pipeline mode?', 'What is continuous pipeline mode?', and 'Choose a data pipeline mode'. Focus on the comparison table, as it clearly outlines the core differences regarding when updates stop, what data is processed, and the ideal data freshness requirements.
From this reading, we can summarize the core trade-off:
| Mode | Latency | Cost | Use Case |
|---|---|---|---|
| Continuous | Very Low (seconds to minutes) | Higher (always-on cluster) | Real-time dashboards, streaming analytics |
| Triggered | Higher (minutes to hours/days) | Lower (pay-per-run cluster) | Daily/hourly reports, periodic batch ETL |
This is a classic engineering trade-off. If your goal is to power a live dashboard monitoring sensor data, the higher cost of a continuous pipeline is justified by the need for minimal latency. Conversely, if you're updating a summary table for a daily business report, a triggered pipeline that runs once a night is far more cost-effective.
How DLT Makes This Possible
You might wonder how DLT can so easily switch between these two very different execution patterns without requiring you to rewrite your code. The answer lies in its declarative nature and its foundation on Spark's Structured Streaming engine.
In a declarative framework like DLT, you define the desired end state of your data—the "what"—and the engine figures out the most efficient way to achieve it—the "how". This separation of logic from execution is powerful. Your pipeline definition (the sequence of Bronze, Silver, and Gold tables) remains the same, and the execution mode is simply a configuration that tells the DLT engine how often to run the logic.
This is analogous to concepts in physics where you can describe a system with a set of equations (e.g., a Hamiltonian) that are independent of the specific time-evolution path taken. The system's definition is separate from its execution over time.
To see how this works under the hood, let's watch a clip from Michael Armbrust, one of Spark's original creators, as he explains how Structured Streaming supports this flexibility.
Delta Live Tables A to Z: Best Practices for Modern Data Pipelines
This video segment explains the relationship between cost, latency, and the different ways a streaming pipeline can be run. It provides the conceptual foundation for DLT's execution modes.
Please watch from 22:54 to 25:48. Focus on his description of the spectrum from manual to scheduled (triggered) to continuous execution. The key takeaway is that you can move along this cost-vs-latency spectrum without changing your code.
Practical Configuration and Exam Tips
In the Databricks UI, selecting the execution mode is as simple as choosing an option from a dropdown menu when you configure your pipeline.
DLT Overview: Modern Software Engineering for ETL Processing
This very brief clip shows you exactly where this setting is located in the DLT pipeline UI and reiterates the core trade-off.
Watch from 09:04 to 09:31. Note how the choice is presented as 'Continuous' for real-time analytics versus 'Triggered' to keep costs down.
For your certification exam, it's crucial to correctly interpret scenario-based questions. Words matter, and there are common pitfalls to avoid.
Understanding Execution Modes in Databricks DLT Pipelines
Let's revisit the certification-focused article to sharpen our understanding of how these concepts appear in exam questions.
Please read the sections 'Matching the Scenario to the Correct Execution', 'Real-World Use Case', and especially 'Common Mistake'. The point it makes about the phrase 'until manually stopped' is a critical distinction for test questions.
As highlighted in the article, be very careful with the phrasing:
- A pipeline that runs and then stops automatically is Triggered.
- A pipeline that runs until manually stopped is Continuous. This is a key giveaway, even if the question mentions "defined intervals" (which in continuous mode refers to the micro-batch trigger interval, not a scheduled run).
A Note on Development vs. Production Mode
When you configure the execution mode, you'll also see another option called Pipeline Mode, with choices for Development and Production. While this isn't our main topic today, it's closely related.
- Development Mode: Optimized for iterative development. It reuses clusters to avoid startup delays and disables automatic retries, allowing you to iterate on your code faster.
- Production Mode: Designed for reliability. It uses a new, dedicated cluster for each run and enables automatic retries to handle transient failures, ensuring your pipeline is robust.
You typically use Development mode while building your pipeline and switch to Production mode for your stable, deployed workflows.
Conclusion
In this lesson, you've learned to differentiate between the two DLT execution modes. This knowledge is fundamental to designing pipelines that meet your business requirements for data freshness while respecting your budget for compute resources.
Key Takeaways
- Triggered Mode: Best for batch processing. Runs once per trigger, processes available data, and then shuts down the cluster. It prioritizes cost savings.
- Continuous Mode: Best for streaming data. Runs constantly to process new data as it arrives. It prioritizes low latency.
- The primary trade-off when choosing a mode is Cost vs. Latency.
- DLT's declarative nature allows you to switch between modes without changing your transformation logic.
- For the exam, remember that a pipeline running "until manually stopped" is in Continuous mode.
Next Steps
You now understand a critical DLT pipeline setting. In the next lesson, we will broaden our scope to cover other important configurations. You will learn to configure DLT pipeline settings, including target schema and storage location, giving you more complete control over your pipeline's behavior and organization.