Problem
A bug fix or new column requires recomputing months of data, while production pipelines keep running. Naive reruns overload systems, double count rows or overwrite correct data.
Also known as: historical-reprocessing, data-backfill
Reprocess historical data safely and efficiently after logic fixes, schema changes or outages.
A bug fix or new column requires recomputing months of data, while production pipelines keep running. Naive reruns overload systems, double count rows or overwrite correct data.
A backfill reruns pipeline logic over past time ranges. It is routine in analytics: logic changes, sources arrive late, outages leave gaps. A planned strategy prevents these reruns from becoming incidents.
Make the job a pure function of a partition key, usually a date, and have it replace that partition's output. The orchestrator then generates one run per partition.
for d in 2026-01-01 .. 2026-03-31 (max 4 parallel):
run job --date d --output orders_v2 # overwrite partition d
validate: row counts, sums vs orders_v1 per day
swap: point view orders to orders_v2
trigger: downstream models for the range
Writing to a new versioned table lets you compare before exposing results. Chunking limits memory and allows resume from the last successful partition. Throttle reads from operational sources or use a replica or snapshot export. Pin the code version and input snapshot so the rerun is reproducible.
For streaming systems, the equivalent is replaying the log from an offset into a new output, as in kappa architecture.
Medium - temporary compute and storage for shadow output
Medium - orchestration and validation tooling
Medium - dependency and ordering concerns
Backfill overwhelms source database or cluster
Mixed old and new logic produce inconsistent history
Downstream tables not refreshed so reports disagree