3 Scheduling in Airflow

 

This chapter covers

  • Running DAGs regularly using schedule intervals
  • Constructing efficient DAGs that load and process data incrementally
  • Designing your DAGs for re-processing past datasets using backfilling

In the previous chapter, we explored Airflow’s UI and showed you how to define a basic Airflow DAG and run this DAG every day by defining a schedule interval. In this chapter, we will dive a bit deeper into the concept of scheduling in Airflow and explore how this allows you to process data incrementally at regular intervals. First, we’ll introduce a small use case focussed on analyzing user events from our website and explore how we can build a DAG to analyze these events at regular intervals. Next, we’ll explore ways to make this process more efficient by taking an incremental approach to analyzing our data and how this ties into Airflow’s concept of execution dates. Finally, we’ll finish by showing how we can fill in past gaps in our dataset using backfilling and discussing some important properties of proper Airflow tasks.

3.1   Running tasks at regular intervals

 
 
 

3.1.1   Use case: processing user events

 
 
 

3.1.2   Defining scheduling intervals

 
 
 
 

3.1.3   Cron-based intervals

 
 
 

3.1.4   Frequency-based intervals

 
 
 

3.1.5   When to use which interval expression?

 
 
 
 

3.2   Processing data incrementally

 

3.2.1   Fetching events incrementally

 
 

3.2.2   Dynamic time references using execution dates

 
 

3.2.3   Partitioning your data

 
 
 
 

3.3   Understanding Airflow’s execution dates

 
 
 

3.4   Using backfilling to fill in past gaps

 
 
 

3.5   Best practices for designing tasks

 
 

3.5.1   Atomicity

 

3.5.2   Idempotency

 
 

3.6   Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage