PrepCity

Backfills and idempotency

Open the lab

By the last page, this is the design you will have built. Drag it, or Show all, to see every part.

Lesson · 6 pages · about 5 min

Backfills and idempotency

A backfill re-runs past days, say after a bug fix. Measured: appending counts each day twice, replacing the day’s partition fixes it, and a task that takes its date from the clock puts every re-run into one day.

What it is
A backfill runs a pipeline again for past days, for example after fixing a bug. A task is idempotent when running it twice gives the same result as running it once.
What it is for
Every pipeline gets re-run: retries, catch-up, fixes. If a re-run adds rows instead of replacing them, each one quietly doubles a day.
Use it when
Write every scheduled task so it can be re-run safely: replace the whole day it is for, and take that day from the run, never from the clock.

Words you’ll learn

  • Data pipeline
  • Catch-up run
  • Backfill
  • Airflow
  • Row
  • Retry
  • Partition
  • Idempotent
  • Logical date
  • Stream

Page by page