top of page

What is Data Backfill?

Oct 24
12 min read
What is Data Backfill?

 

Data backfill is the process of loading or recomputing data for past periods to create, repair or update historical results. It is used when records were missed, a new reporting destination needs history, or corrected processing logic must be applied to earlier data.

 

For a UK home lab, that could mean rebuilding daily broadband summaries from retained router measurements after fixing a unit conversion. In a larger pipeline, it might mean populating a new column across years of records or rebuilding selected reporting partitions after a faulty transformation.

 

A backfill can only reconstruct what its sources support. It cannot recover a measurement that was never collected or invent an old value that has been overwritten without history. The objective is a defined, trustworthy historical result, rather than simply getting old jobs to run again.

 

Why would you backfill data?

 

Historical output can be missing while source data still exists. A collector may have stored events during a reporting outage, a downstream job may have skipped an interval, or a newly introduced dataset may need earlier records.

 

Existing output can also be wrong or incomplete. A calculation may have used the wrong units, a field may have been added without historical values, or late corrections may change a previously published total. Backfilling then means deliberately revisiting the affected scope.

 

It is part of a wider data pipeline. The backfill must use appropriate source data, transformation rules and publication checks, just as live processing does. Running a separate script does not remove those dependencies.

 

Backfill, replay, catch-up and restore

 

These activities can overlap, but they answer different questions.

 

Activity

Main purpose

Important limit

Backfill

Populate or correct historical output

Needs a defined historical scope and usable source

Replay

Read earlier retained events again

Available history and repeated effects need checking

Catch-up

Process work behind the current position

May use old logic unless deliberately changed

Restore

Recover stored data from a backup

Does not automatically recompute it with corrected logic

 

A batch run can perform a backfill, but not every batch job is a backfill. A live pipeline can also process an old event without launching a separate historical run. The useful distinction is the intended result and the boundary around the work.

 

Define what “historical” means before running anything

 

A reporting day, a source snapshot and a processing date are different things. A measurement recorded on 1 October might arrive on 3 October, then receive a correction on 4 October. All three times may matter.

 

Event time says when the observation or business event belongs. Arrival time says when the system received it. A source revision or transaction position identifies which version of the fact is being used. Processing time says when the backfill runs.

 

Part of the run contract

Question to answer

Example

Historical interval

Which event times belong?

Start inclusive, end exclusive

Source state

Which retained inputs or snapshot are authoritative?

A manifest or revision cutoff

Transformation

Which rules and dependencies apply?

A recorded code and configuration version

Output identity

What does one output row represent?

Day and device

Publication rule

How does the new result become visible?

Checked replacement of selected partitions

Reconciliation

What happens to later arrivals and live updates?

Revisit affected intervals under a defined policy

 

For a time range, a half-open interval is often useful: include the start and exclude the next boundary. An event exactly at the next midnight then belongs to the next day, avoiding an overlap between adjacent runs. Record the timezone and timestamp precision as part of that rule.

 

A cutoff alone does not create source history

 

If a mutable source row has already been overwritten, filtering its current timestamp cannot necessarily recover its earlier value. You need suitable retained versions, immutable input files, change history or a source-supported snapshot.

 

Choose whether the goal is to reproduce what was known then or produce the best corrected result now. Those can legitimately differ. A present-day customer category or device mapping applied to old events may produce a different answer from the mapping that was valid when they occurred.

 

Also record dependent inputs, such as reference tables and unit definitions. Pinning application code while allowing a lookup table to change does not make the run fully reproducible.

 

Data backfill infographic covering historical scope, pinned inputs and logic, bounded recomputation, validation, atomic publication and reconciliation with live updates

 

How should a backfill be carried out?

 

The safe sequence separates defining work, computing a candidate and publishing an accepted result.

 

  1. Identify the missing or incorrect intervals and confirm the required source history exists.

  2. Record the interval, input state, transformation version and expected output identity.

  3. Process bounded partitions into a controlled staging or candidate result.

  4. Validate coverage, identities, values and dependencies before publication.

  5. Publish using the destination's appropriate consistency mechanism, then reconcile later changes and verify downstream results.

 

Start with a small representative partition. It should exercise meaningful cases such as an interval boundary, an update, a deletion and an empty output, rather than merely the easiest day. Estimate source reads, destination writes and resource limits before expanding the range.

 

Partitioning helps recovery, but is not a correctness guarantee

 

A partition divides the work into a manageable scope, often by date and sometimes by tenant, device or another key. It can make progress, retries and validation easier to track.

 

The partition must match the calculation's dependencies. A rolling seven-day metric needs data outside the day being published. A correction to one event can affect several downstream windows. Rebuilding only the visible output day may leave those dependent results stale.

 

Record publication status separately from computation status. “Candidate computed”, “validated” and “published” are useful distinct milestones. A checkpoint should identify committed work, not just the last source record a worker happened to read.

 

What did our local backfill experiment show?

 

Techie Broadband ran a disposable local experiment on 24 October 2026 using Python 3.12.14 and SQLite 3.53.1. Seventeen assertions checked actual SQL results and transaction behaviour; two checked UK calendar intervals. All 19 passed, including the checks deliberately demonstrating unsafe approaches.

 

The source was synthetic, with stable event identities, explicit revisions, arrival timestamps and a deletion marker. The main reporting interval was 1 October 2026 in UTC, from midnight inclusive to the following midnight exclusive. Values were small illustrative byte amounts, not measured broadband traffic.

 

Repeating an additive load doubled the result

 

At the first source cutoff, three events contributed 600 bytes. Appending that aggregate again on a rerun produced 1,200 bytes. Replacing the same bounded partition with its recomputed result twice left 600 bytes and three contributing events.

 

Local test

Observed result

Meaning in this design

Append the same 600-byte aggregate twice

1,200 bytes

A retry added the result again

Replace the selected partition twice

600 bytes; 3 events

Repetition preserved the intended result

Delete inside an uncommitted replacement; read through another connection

Reader still saw committed 600 bytes

The partial deletion was not published to that reader

Raise a deliberate error after deletion, then roll back

Original 600 bytes remained

The failed transaction preserved the previous result

Refresh only groups present in the corrected output

Wrong total of 700 bytes

An obsolete group remained

Replace the full selected partition with corrected groups

Correct total of 400 bytes

The vanished group was removed

Read the adjacent day's partition

Its 400-byte value remained

The replacement stayed within its intended scope

 

This illustrates idempotent processing: repeating the same defined operation should not add another intended effect. It does not mean every rerun must forever produce the same answer when the source state or transformation changes.

 

Why an upsert did not remove a vanished group

 

The original result contained a router group and an old-device group. Later source changes removed the old-device contribution entirely. Updating only the router group left the old-device total of 300 bytes behind, producing 700 instead of 400.

 

A unique key can prevent duplicate rows while still leaving a wrong dataset. Upsert logic must account for rows or groups that disappear, or the publication policy must replace the complete intended scope. An empty recomputed partition also needs an explicit policy; “no output rows” must not accidentally mean “keep all old rows”.

 

The experiment used a local SQLite transaction. It did not test a distributed warehouse, object-store publication, a process crash or power-loss durability. A deliberate exception followed by rollback is a narrower observation. Its configured journal mode was DELETE with synchronous=FULL.

 

How do late data, corrections and deletions change the answer?

 

The historical interval can stay fixed while the authoritative source state changes. In the experiment, a late event arrived after the initial cutoff, followed by a correction and a deletion marker.

 

Source state used for the same UTC day

Contributing events

Recomputed total

Known by 3 October at 00:00 UTC

3

600 bytes

Known by 3 October at 06:00 UTC, including the late event

4

650 bytes

Known by 5 October at 00:00 UTC, including correction and deletion

3

400 bytes

 

The second state added a 50-byte event. The final state changed another event from 200 to 250 bytes and removed the 300-byte old-device contribution: 650 + 50 - 300 = 400 bytes. Those are deliberately constructed observations from the synthetic source.

 

Selecting the original cutoff again reproduced its original result because the experiment retained explicit revision history. That is not evidence that arbitrary mutable production tables can reproduce old snapshots in the same way.

 

Watermarks and lookback windows need a clear policy

 

Apache Beam distinguishes event time from processing time and describes watermarks as estimates of event-time progress. A live processor's position is not, by itself, proof that no historical correction can ever appear.

 

Choose how late data is handled: a bounded lookback, targeted reprocessing of affected partitions, a separate correction feed or another explicit reconciliation mechanism. A three-day lookback only covers data within the assumptions used to choose it. It is not a guarantee against a record arriving four days late.

 

Our stream processing guide explains the timing, state and late-event problems that can connect continuous processing to historical recomputation. Backfills must also consider what downstream windows or materialised results need updating afterwards.

 

How do you stop a backfill overwriting newer live data?

 

If live processing and a historical run write the same destination, their arrival order is not a reliable freshness rule. An older source revision processed later can overwrite a newer one unless the write contract prevents it.

 

In a separate local test, the destination already contained source revision 2 with value 250. An unconditional upsert from an older backfill replaced it with revision 1 and value 200. A conditional upsert that accepted only a greater source revision preserved revision 2 and value 250.

 

That guard depends on a trustworthy, comparable source revision. It is not a general “newer timestamp wins” recipe. It also does not solve a different transformation version needing to recompute the same source revision. Source freshness and model version are separate dimensions.

 

Choose a coordination and publication strategy

 

Possible approaches include giving live and historical processing disjoint ranges, pausing writes for a controlled cutover, building a versioned replacement dataset, or combining a source snapshot with a tracked change position and reconciliation. The right choice depends on the source and destination contracts.

 

A long backfill may need to apply changes that occurred while its initial snapshot was being processed. Retain enough change history, track the hand-off position and check for gaps or overlaps. A snapshot plus an unrelated “latest” read can miss the relationship between those two streams of work.

 

Database isolation matters too. A transaction does not universally mean that every successive query sees one unchanged snapshot; the database and isolation level determine that. Confirm the actual source-read and destination-publication semantics rather than assuming a single transaction spans every system.

 

If the destination supports atomic replacement or a versioned pointer switch, consumers can be moved to an already checked result. If it does not, design how partial visibility is controlled and how consumers know which version is complete. The word “atomic” must name its actual boundary.

 

What do scheduling tools handle for you?

 

The Airflow backfill documentation, checked in version 3.3.2, describes creating historical runs, selecting reprocessing behaviour and controlling concurrent backfill runs. Its backfill concurrency limit is independent of the DAG's ordinary active-run limit.

 

That schedules work; it does not establish that the task's writes are repeat-safe or its source data complete. Airflow's dry run shows candidate dates, while actual creation also depends on run state and the chosen policy. Do not confuse a scheduling preview with an execution or data-quality test.

 

Dagster's partitioned-asset documentation similarly distinguishes selected partitions from the number of runs used to materialise them. A backfill can cover a partition range in one run when the code and policy support it. More runs are not inherently more correct.

 

Schema changes do not necessarily populate history

 

The dbt incremental model documentation explains that its schema-change options do not automatically backfill values in old rows for a newly added column. A column existing is therefore different from its historical values being populated.

 

dbt's unique-key configuration can support updating existing rows, depending on adapter and strategy. It still needs a genuinely suitable key and validated source rows. Check duplicates, null keys, deletions and the scope selected by incremental filters before relying on a rerun.

 

We did not execute Airflow, Dagster or dbt for this article. The original results came from the explicitly described SQLite experiment. Product commands and flags vary by version, so there is no untested production backfill command to copy here.

 

How do you protect live processing and downstream systems?

 

A historical run may scan far more data than an ordinary incremental job. Limit concurrency and rate against the real bottlenecks: source database load, storage I/O, API allowance, warehouse capacity, network throughput and destination contention.

 

Measure the effect on live freshness, not just backfill throughput. Reserve capacity for current work, choose pause conditions and allow recovery from a failed partition. Smaller partitions can reduce the amount retried after a failure, while excessively small ones add scheduling and setup overhead.

 

Backfills can also repeat downstream actions. Rebuilding a table should not accidentally resend old alerts, trigger automation or create another external transaction for every historical record. Separate recomputation from notifications and make any intentional replay of effects explicit.

 

For a UK NAS rebuilding cloud reports, keep raw input versions available until validation and rollback decisions are complete. More workers do not create extra upstream bandwidth or remove the receiving service's limits. Where the archive is already local, process locally where appropriate instead of repeatedly transferring the same raw data.

 

Why do UK clock changes matter to a backfill?

 

A local reporting day is not always 24 elapsed hours. GOV.UK's clock-change dates confirm that the UK moves forward on 29 March 2026 and back on 25 October 2026.

 

Using Europe/London timezone rules, we constructed each local midnight-to-midnight interval and converted its boundaries to UTC before calculating elapsed duration.

 

UK local reporting day

UTC start, inclusive

UTC end, exclusive

Elapsed hours

29 March 2026

29 March, 00:00

29 March, 23:00

23

25 October 2026

24 October, 23:00

26 October, 00:00

25

 

This executable Python example checks the spring interval using the standard library and available IANA timezone data:

 

from datetime import datetime, timedelta, timezonefrom zoneinfo import ZoneInfozone = ZoneInfo("Europe/London")start = datetime(2026, 3, 29, tzinfo=zone)end = start + timedelta(days=1)hours = (end.astimezone(timezone.utc) - start.astimezone(timezone.utc)).total_seconds() / 3600assert hours == 23print(hours)

 

It prints 23.0. The experiment used system timezone data version 2025b and checked both intervals. Do not assume that adding 86,400 elapsed seconds defines every local calendar day. During the autumn change, a local clock time can also occur twice; preserve an unambiguous instant or offset when identifying observations.

 

The synthetic SQL experiment used a UTC reporting day. These UK calendar calculations are a separate boundary example, rather than a claim that its 600-byte dataset represents either clock-change day.

 

How do you know a backfill is complete and correct?

 

Compare the published result against the run contract and a trustworthy reference. Row counts alone are insufficient: a duplicate and a missing row can cancel out, and a correction can change values without changing counts.

 

Check

Question it answers

What can still be wrong

Interval and partition coverage

Was the intended scope processed?

The wrong source version was used

Identity and uniqueness

Does each intended entity appear correctly?

Values or units can still be wrong

Counts and aggregate totals

Do expected relationships reconcile?

Compensating errors can hide

Deletions and empty outputs

Were obsolete results removed appropriately?

A live update may still be overwritten

Published version and downstream state

Are consumers using the checked result?

Later arrivals may require reconciliation

 

For release and investigation:

 

  • Keep a manifest of source state, interval, timezone, transformation and output version.

  • Reconcile accepted, rejected, corrected and deleted records without silently turning missing data into zero.

  • Check representative identities and values alongside totals and coverage.

  • Verify that retries and partial failures preserve the intended publication boundary.

  • Inspect live freshness and downstream results after the historical result is published.

 

Our data integrity guide explains why correct bytes, complete records and valid relationships are different checks. A green scheduler status cannot substitute for them.

 

Use least-privilege access to historical sources and destinations, and apply current retention and deletion rules to staging datasets as well as final output. A backfill must not unintentionally resurrect records that should remain deleted or spread sensitive history into an unprotected temporary location.

 

The useful outcome is a verified historical dataset with known provenance, controlled visibility and a policy for later changes. Our networking terminology guide connects that outcome with the ingestion, storage and processing concepts around it.

 

Frequently asked questions

 

What is data backfill in simple terms?

 

Data backfill means loading or recomputing earlier data to populate missing history or correct existing historical results. It requires usable source data and a clear definition of the period and output being rebuilt.

 

Is backfill the same as restoring a backup?

 

No. Restoring a backup recovers stored data. A backfill processes historical source data to create or update an output, potentially using corrected rules. A restored dataset may provide a source for a backfill, but the activities are distinct.

 

Can a backfill recover data that was never collected?

 

No. It can only reconstruct results supported by retained sources or another trustworthy record. If the observations do not exist, disclose the gap rather than presenting invented or estimated values as recovered measurements.

 

Does an upsert make every backfill safe?

 

No. It can still overwrite newer live values, retain obsolete rows or use the wrong input scope. Correctness also depends on identity, revisions, deletions, transformation version, validation and the publication boundary.

 

Can a backfill run while the live pipeline continues?

 

Yes, when the design coordinates overlapping writes and preserves enough source history for reconciliation. Options include separate ranges, conditional writes or a checked replacement dataset. Concurrent execution alone does not establish that those boundaries are safe.

 

Why might a daily backfill contain 23 or 25 hours?

 

A reporting day defined in a local timezone can span a daylight-saving clock change. In Europe/London, the spring transition produces a 23-hour day and the autumn transition a 25-hour day. Define calendar boundaries explicitly and convert them to unambiguous instants.

 
 
UK Techie Broadband Providers
bottom of page