learntodriveai.dev/Data Engineering/Hybrid Batch and CDC Pipelines
Data EngineeringProject 127 units

Hybrid Batch and CDC Pipelines

Rachel ThorntonDirector of Digital Operations · Cement manufacturer · St. Louis, Missouri, USA
Email · from Rachel
These live in separate systems. I need them in one place because I believe our intermittent quality failures correlate with specific kiln temperature profiles, but I cannot prove this without combining the data sources.
Chat with Rachel

What you hand back

  • An architecture sketch for both data velocities
  • Batch extraction with checkpoints and a landing zone
  • A kiln stream bridged into Kafka with a batch handoff
  • Three marts, each built for its consumer
  • Cross-tool lineage with freshness and cost tracking
  • A quality and kiln correlation table

7 units

  1. Unit 1: Discovery and the Architecture Sketch

    Read Rachel's brief, question her about both data sources, and sketch the architecture before anything is built.

    Open unit 1
  2. Unit 2: Infrastructure Architecture — Path-Scoped Memory and the Multi-Agent Pattern

    Adapt the layer rule files to the sketch, then map each tool connection to the work phase that needs it.

    Open unit 2
  3. Unit 3: Batch Extraction with Checkpoints and Landing Zone

    Profile the ERP source, set the extraction order so reference tables land first, and build batch extraction into the landing zone.

    Open unit 3
  4. Unit 4: The CDC Path and the Hybrid Handoff

    Bring both plants' kiln feeds into one Kafka topic and design the handoff where batch and live data overlap.

    Open unit 4
  5. Unit 5: Multi-Consumer Schema Design and Transformation

    Write the schema contract for three consumer surfaces, plan how each column can change, and build the models.

    Open unit 5
  6. Unit 6: Cross-Tool Lineage, Incident Diagnosis, and the First Correlation

    Trace lineage across the pipeline in Dagster, set freshness and cost tracking per mart, and produce the first quality and kiln correlation.

    Open unit 6
  7. Unit 7: Close and Deliver

    Audit the repository against its layer rules, test it in a second coding tool, record the dispatch request decision, and push.

    Open unit 7
Read the full brief

You're building a hybrid data pipeline for Ashbridge Cement, a two-plant cement manufacturer in the US Midwest — combining daily ERP batch extracts with live kiln sensor streams so the production team can finally see quality results and kiln conditions in the same place.

The discipline skills: batch extraction with checkpoint-based resumption and object-storage landing zones, hybrid batch/CDC handoff design across an overlap window, Kafka consumers with manual offset commit, multi-consumer schema design with materialization chosen per consumer, cross-tool lineage from Dagster through dbt to BigQuery, and structured incident diagnosis.

The AI-direction lesson: you are the architect now. AI builds each piece competently — the batch extractor, the CDC consumer, the dbt models — but it does not design the seams where those pieces meet. Batch and CDC composed without a handoff design produce a gap or an overlap. One wide mart serves three consumer surfaces badly. Three agents building in parallel produce locally correct output that does not compose. Your job at this altitude is the integration AI cannot infer from either side alone — the handoff strategy, the multi-consumer schema contract, the interface between agents. You also design the infrastructure that holds the work together: path-scoped project memory, phase-scoped tool connectivity, agent-specific context, and hook selection across the full tier spectrum.

Your Role

You're Rachel Thornton's hybrid pipeline architect. She has two data velocities across two plants with two different streaming protocols, and she wants them unified without being told how. Her brief is short and direct — the problem, not the recipe. The architecture belongs to you.

The relationship with AI has shifted again. You supply the architecture; AI implements within it; you verify at the seams. Verification judgment — which technique fits which check — is now your active decision, not a checklist.

What's New

Last time you built a Debezium CDC pipeline with PII governance enforced across every surface, using composed multi-agent verification as a new mid-project concept.

This time the brief is thin and nothing is pre-committed. Batch versus CDC per source, which consumer surfaces to build, which materialization per model, which multi-agent orchestration pattern to use — all of that is yours to design before AI builds anything. Composed verification is no longer new; you deploy it by judgment. The infrastructure itself becomes architecture: different directories carry different rules, hooks span a spectrum from deterministic scripts to full-agent verification, and portability testing in a second AI coding agent is how you find out whether what you built survives outside the tool you built it in.

The hard part: hybrid pipelines fail at the seam. Batch and CDC can each be individually correct and the composed pipeline still wrong — a gap where the backfill ends, duplicates where CDC picks up, late-arriving events silently dropped into a closed partition, messages lost or duplicated during a consumer group rebalance. Three agents producing locally correct output can compose into a grain mismatch that passes every component test. Nothing throws an error. You have to design for it.

Tools

  • PostgreSQL — the ERP source at Ashbridge (established)
  • Apache Kafka (Docker Compose, KRaft mode) — streaming platform (established)
  • Debezium — CDC connector, now used alongside batch (established from P11)
  • MQTT broker (Eclipse Mosquitto) — new, bridges plant sensor streams into Kafka
  • MinIO — local S3-compatible object storage as the landing zone (new architectural pattern)
  • dbt Core — transformation layer (established)
  • BigQuery — warehouse (established)
  • Dagster — orchestration, now the primary surface for cross-tool lineage (established)
  • GitHub Actions — CI/CD (established)
  • Claude Code — primary AI coding agent, with path-scoped project memory, phase-scoped MCP connectivity, the full hook tier spectrum, and a multi-agent orchestration pattern
  • A second AI coding agent (Codex CLI or Cursor) — for portability testing and for running the review agent in the multi-agent pattern

Materials

You'll receive:

  • Project governance files — an AGENTS.md carrying the cross-cutting conventions, imported by a CLAUDE.md that adds the Claude Code briefing, and three path-scoped rule files in .claude/rules/ (one each for the staging, intermediate, and mart directories) that load only when a file under that directory is touched
  • PostgreSQL dump — Ashbridge's ERP production data (warehouses, products, batch records, quality tests)
  • Kiln sensor samples — a sample of each plant's kiln feed, in the shape its control system exposes it
  • Schema design template — an empty interface contract you complete before the multi-agent build begins
  • MCP configuration — pre-built for the source database, ready to scope by workflow phase
  • Hook scaffold directory — one example per hook tier (deterministic, external-service, fast-model, deep-agent), every one a type: command hook, to select from rather than use wholesale
  • Docker Compose stack — PostgreSQL, Kafka, Debezium Connect, MQTT broker, MinIO, Dagster

Rachel's first-contact email arrives in the chat. Everything else is your design.

Materials · 27 files
Start Project 12

You work at a computer with a terminal. Signed in, your place is saved.