Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
Python & Django

Moving and Transforming Data Reliably

Last updated:

The input will be wrong

Pipelines fail in production because real data contains things the sample did not: missing fields, unexpected encodings, dates in a different format, and records that break an assumption nobody wrote down.

A pipeline that stops on the first bad record will stop most nights. One that quarantines bad records and processes the rest keeps working while you investigate.

Design principles

  1. Validate on entry and quarantine what fails, with the reason
  2. Make each stage restartable from its input rather than from the beginning
  3. Store intermediate output, so a later failure does not require redoing earlier work
  4. Be idempotent — rerunning must not duplicate
  5. Reconcile — count in, count out, count quarantined

Reconciliation is the safety net

Every run should report how many records entered, how many completed, how many were quarantined and how many were rejected. Those numbers should add up.

  • An unexplained gap means silent data loss
  • A quarantine count that jumps means the input changed
  • A completed count of zero means something upstream broke
  • All three should alert

Handle the awkward realities

RealityHandling
Encodings varyDetect and normalise on entry
Dates in several formatsParse explicitly, reject ambiguity
Duplicate source recordsDeduplicate on a defined key
Late-arriving dataDesign for reprocessing a period
Source unavailableRetry, then alert — do not silently skip

Alert on absence, not just errors

A pipeline that processes nothing looks identical to a pipeline with nothing to process. Only a completion signal with an expected volume distinguishes them.

That is the alert that catches the failures which otherwise run for weeks.

Frequently asked questions

Do we need a pipeline framework?

For a handful of jobs, plain Python with a scheduler is simpler. Frameworks earn their place with complex dependencies between many jobs.

What about very large volumes?

Batch and stream in chunks rather than loading everything into memory. That single practice handles most volume problems.

How do we test a pipeline?

With real sample data including the awkward records, and with deliberately malformed input. Testing only clean data tests the wrong thing.

What if the source format changes?

Validation catches it and quarantines the records. That is far better than processing them wrongly and discovering it later.

Keep reading

Pipeline that fails silently overnight?

Reconciliation and absence alerting fix that. Happy to look at how yours reports.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

Custom Software DevelopmentWeb DevelopmentMachine Learning