The Challenge
A nightly batch job reconciled the day’s records in a single pass, built back when that meant a few thousand rows. At current volume it ran past its maintenance window more nights than not, and a single failure meant rerunning the entire batch from scratch the next day. The tempting first fix - shrinking the batch window, or splitting it by customer segment - buys time without solving the underlying problem, which is that the job’s runtime scales with total data volume, not with how often it runs.
The Approach
- Replaced the single overnight pass with an incremental pipeline that processes records continuously as they arrive, instead of batching a full day at once
- Added checkpointing so a failure mid-run resumes from the last processed record instead of restarting from zero
- Moved transformation logic out of the batch job and into a queue-backed worker pool that scales independently of ingestion
The Result
- Record volume scaled 100x with no increase in processing lag
- Zero missed runs since the rebuild, versus roughly monthly before it
- Recovery time after a failure down from a full overnight rerun to minutes
The migration without a cutover weekend
Both pipelines ran in parallel for two weeks before the old one was switched off, with a daily reconciliation job comparing their output record-for-record. That surfaced two genuine bugs in the new pipeline - both edge cases around records that arrived out of order relative to their timestamps - before the cutover, not after. Nothing about “ran in parallel and diffed the output” is novel; it’s just the kind of unglamorous validation step that’s easy to skip under deadline pressure and expensive to regret skipping.
Where it landed
The pipeline now handles two orders of magnitude more volume than the job it replaced, without anyone having to think about scaling it again - which was always the actual goal. Nobody gets paged for a missed run anymore, because there isn’t a single run to miss.