Insights · Ingestion

Onboard a data source with one row, not a new pipeline

If every new data source means a new notebook, onboarding speed is capped by how fast your team can write and review code. Config-driven ingestion removes that cap.

The idea

Most ingestion pipelines do the same five things: connect, read, add audit columns, check quality, write. The differences between sources, such as format, location, schedule, target and rules, are data, not logic. So store them as data:

source_name     format  location                 target_table          qa_ruleset
src_orders      table   source.orders            bronze.orders         orders_v1
src_inventory   csv     /Volumes/.../inventory   bronze.inventory      inventory_v1
src_partners    json    /Volumes/.../partners    bronze.partners       partners_v1

One tested pipeline reads that table and loops over the active rows. Adding a source becomes a reviewed one-row change, and every source gets the same audit columns, logging and quality checks for free.

On one Azure and Databricks platform we built this way, onboarding a new client data source became about 90% faster, and, with schema validation and monitoring added at the point of ingestion, production data issues fell by about 80%.

The core loop

for src in spark.table("config.ingestion_sources").where("is_active").collect():
    df = read_source(src.format, src.location)          # table, csv, json, ...
    (df.withColumn("_batch_id", lit(batch_id))
       .withColumn("_ingested_at", current_timestamp())
       .write.mode("append").option("mergeSchema", "true")
       .saveAsTable(src.target_table))

The quality step works the same way: rules live in a qa_rules table, keyed by ruleset, and a single task evaluates them against the latest batch. Rules marked error stop the job; rules marked warn are logged.

Where it goes wrong

Putting business logic in config

Config should describe where data comes from and where it lands. Once people start encoding joins, filters and calculations as config strings, you have built a worse programming language with no tests. Keep transformation in code (dbt or notebooks), downstream of ingestion.

Config that isn't reviewed

A config row can break production as easily as code. Keep the config in Git, deploy it the same way as code, and validate it before any data moves. In our reference pipeline, the first task checks that every active source has a QA ruleset before ingestion starts.

One framework for everything

Streaming sources, CDC feeds and huge historical backfills often need their own patterns. Config-driven ingestion is for the long tail of ordinary batch sources, which is usually most of them.

The checklist

  • Every source has a format, location, target, schedule, ruleset and an on/off switch.
  • Every row written carries a batch ID and ingestion timestamp.
  • Every run is logged per source, with row counts.
  • Quality rules run on each batch before anything moves past Bronze.
  • Config changes go through the same review and deployment as code.

Want this on your platform? Book a free discovery call, or score your platform in three minutes first.