Cutting a 15-billion-record daily feed from 10 hours to 2
A split/merge ingestion framework that removed small-file overhead and freed 600 CPU cores for a revenue-critical data feed.
Data engineer, design and build
- Apache NiFi
- PySpark
- Hadoop
- Airflow
Context
A policy-and-charging data feed arrives as roughly 1 TB, 100,000 files and 15 billion records every day. It feeds revenue reporting, customer analytics and reconciliation, all under a D+3 delivery deadline that was getting tighter as volume grew.
Role
I owned the analysis and the design, and built the ingestion framework myself, working with the operations team that runs it.
Approach
Profiling pointed at two causes, not one: a flood of small files, and each feed being handled by its own near-identical flow.
- Split/merge direct ingest. Records are split on arrival, tagged with the feed they belong to, and merged into right-sized files, so one flow serves several feeds.
- Per-feed merge tuning. Minimum bin size and maximum bin age are set per feed profile, which removes small files without holding data back longer than the deadline allows.
- Centralised multi-feed handling. One pipeline to monitor and change instead of many copies.
Result
Last-mile ingestion dropped from 10 hours to 2 (−80%). The downstream PySpark base-load job released 600 cores and 1.2 TB of RAM back to the shared cluster.
What I’d do differently
I would add hotspot monitoring and alerting on the merge stage from day one. It is where a stalled feed first shows up, and I proposed it as a follow-up rather than building it in.