What Is a Backfill? Understanding a Common Data Evolution Pattern

Search for a command to run...

No comments yet. Be the first to comment.
Lessons learned while building a side project on a budget.

The problem it solves Any system that processes a stream of messages—orders, events, uploads, whatever—will eventually hit one it can’t handle. Maybe the message is malformed. Maybe a downstream depen

Two Ways to Control Who Can Deploy to Production in GitHub Actions Say you have a GitHub Actions workflow that someone can manually trigger to deploy something to an environment. It could be productio

You've probably heard the term webhook in engineering conversations and assumed it was something complicated. It isn't. A webhook is simply an HTTP endpoint on your server that another system calls to

Code Like a Woman
45 posts
Making modern software engineering concepts feel approachable through simple mental models and practical lessons learned.
The first time I was asked to build a backfill for a production system, I remember thinking:
This sounds important... and a little scary.
It sounded like one of those engineering terms that everyone else seemed to understand except me.
But once I learned what a backfill actually is, I realized the concept is surprisingly simple.
If English isn't your first language, the term can sound a bit mysterious.
Outside of software, to backfill simply means:
To fill something in after the fact.
The idea is that something already exists, but there's a gap that needs to be filled later.
For example:
In construction, workers backfill a trench after installing underground pipes by filling it back in with soil.
In human resources, companies backfill a position when they hire someone to replace an employee who left.
Different contexts, same idea.
You're going back to fill something that wasn't filled before.
Software engineering borrowed exactly that idea.
A backfill is the process of updating historical data so it conforms to the current version of your data model.
Or, put another way:
It makes old data look as if today's data model had always existed.
I find this to be the simplest way to think about backfills.
Data models evolve.
No matter how carefully you design your database, requirements change.
You might:
split one field into several
introduce a new table
rename a column
change how information is represented
move data to a different storage system
remove fields that are no longer needed
Updating the application code is only half the job. The application now understands the new model. Your existing data doesn't.
No. While data model evolution is the most common reason to perform a backfill, it's not the only one.
Teams also perform backfills when importing older historical records that weren't previously available. For example, you might initially load one year of transaction history and later decide to import the previous five years.
In both cases, you're filling historical gaps—just for different reasons.
Imagine your application has been storing customer addresses like this for years:
address = "123 Main St, New York, NY"
Eventually, the business wants to search customers by city and state.
So the model evolves into:
street
city
state
Every new customer is stored using the new structure.
But what about the millions of customers that already exist?
Their data doesn't magically reorganize itself.
A backfill reads those historical records, extracts each component, and populates the new fields so both old and new records follow the same model.
Once the backfill is complete, every customer record follows the same structure, regardless of when it was created.
Not exactly.
The terms are closely related and are often used interchangeably, but I find it helpful to think about them in terms of their goal.
A data migration typically moves or restructures data.
A backfill updates historical data so it matches the current version of your model.
Many migrations include a backfill as one of their steps, but not every backfill is part of a migration.
Sometimes you're doing both at the same time.
When someone says:
"We need to build a backfill."
it's easy to imagine some mysterious, high-risk engineering task.
In reality, the concept itself is straightforward.
You're simply updating historical data because your understanding of the domain has evolved.
Of course, executing a production backfill safely is another story.
Large datasets often require batching, monitoring, idempotency, retry mechanisms, and careful planning to avoid impacting users.
Those challenges are real.
But they're challenges of execution—not of the concept itself.
Software systems evolve. Data evolves with them. Whether that means adapting historical records to a new data model, enriching existing data, or filling in historical gaps, backfills are simply the mechanism that allows historical data to catch up.
Viewed through this lens, a backfill isn't an unusual operation—it's a natural part of building evolving software systems.