Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 96/ 160
05. Data Lakehouses & Open Table Formats

Change Data Feed (CDF) & Incremental Lakehouse Processing

Consume table change feeds to build incremental downstream jobs instead of full reloads.

AdvancedCDF · Incremental · Change Feed3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Snapshot + exact starting table version. Next, only committed changes in version range. Finally, durable offset and enough table history.

Think of it like…

CDF is a warehouse's ledger of goods added, replaced, and removed since a bookmarked page, saving downstream teams from recounting the whole warehouse every morning.

Where you’ve seen it

Delta CDF reads _change_type, _commit_version, and _commit_timestamp from version 41 to 45; the target marks a 3-state upsert by source primary key and commits offset 45 only after MERGE succeeds.

Words you’ll hear

CDF
A table-level ordered feed of row changes tied to transaction versions in formats or engines that support it.
Incremental
A downstream strategy that processes only new or changed keys instead of recomputing a complete dataset.
Change Feed
The commit-derived metadata containing operation type, table version, timestamp, key, and before/after values as supported.
Operational boundary
Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent. Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

Visual diagram

Loading interactive diagram

Theory & deep dive

CDF: the working mechanism

A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance.

Snapshot + exact starting table version. Only committed changes in version range, then idempotent insert/update/delete semantics; this exposes the state governed by Change Feed.

Change Data Feed & Incremental Lakehouse Processing in one concrete design

Delta CDF reads _change_type, _commit_version, and _commit_timestamp from version 41 to 45; the target marks a 3-state upsert by source primary key and commits offset 45 only after MERGE succeeds.

Key takeaway: A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance

Change Data Feed & Incremental Lakehouse Processing: failure mode and production response

Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.

Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure. Track Committed version as "checkpoint only after sink commit", and make Retention visible to the dataset owner.

Key takeaway: Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

How it works, step by step

Step 1 of 4
CDF

1. Bootstrap

Snapshot + exact starting table version. A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance.

snapshot + exact starting table version
Key numbers at this step
Committed version
checkpoint only after sink commit
Incremental
A downstream strategy that processes only new or changed keys instead of recomputing a complete dataset.

When to use it & trade-offs

What it is

A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance. Delta CDF reads _change_type, _commit_version, and _commit_timestamp from version 41 to 45; the target marks a 3-state upsert by source primary key and commits offset 45 only after MERGE succeeds.

Why it matters: Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent. Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

When to reach for it

  • Consume table change feeds to build incremental downstream jobs instead of full reloads.
  • Choose CDF because it provides this capability: A table-level ordered feed of row changes tied to transaction versions in formats or engines that support it.
  • Keep evidence for Committed version at "checkpoint only after sink commit" so the last production stage-Checkpoint/retain - durable offset and enough table history-remains testable.

When to avoid or be careful

  • Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.
  • Do not conflate Incremental with CDF. The second concept contributes different behavior: A downstream strategy that processes only new or changed keys instead of recomputing a complete dataset.
  • Release only after this guardrail is in place: Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

CDF / Incremental / Change Feed - roles, limits, and operating cost

CDF
Best for: A table-level ordered feed of row changes tied to transaction versions in formats or engines that support it.

Strengths: A table-level ordered feed of row changes tied to transaction versions in formats or engines that support it. A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance.

Watch out: Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.

Incremental
Best for: A downstream strategy that processes only new or changed keys instead of recomputing a complete dataset.

Strengths: A downstream strategy that processes only new or changed keys instead of recomputing a complete dataset. In this workflow it supports: Apply - idempotent insert/update/delete semantics.

Watch out: The operating cost is real: oldest retained CDF version below oldest consumer checkpoint.

Change Feed
Best for: The commit-derived metadata containing operation type, table version, timestamp, key, and before/after values as supported.

Strengths: The commit-derived metadata containing operation type, table version, timestamp, key, and before/after values as supported. Its output can be checked with Dedupe key.

Watch out: Operating guardrail: Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for CDF, and how would Committed version reveal it?”
  • “Why is Incremental distinct from this behavior: the commit-derived metadata containing operation type, table version, timestamp, key, and before/after values as supported?”
  • Production clue: Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.
  • Design probe: Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

Benchmarks & rules of thumb

Committed version -
checkpoint only after sink commit
Retention -
oldest retained CDF version below oldest consumer checkpoint
Dedupe key -
table snapshot identity plus source key and operation order

Common mistakes & follow-ups

Common interview mistakes

  • Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.
  • Reporting success from a job exit code without checking Committed version and Retention.
  • Treating this example as complete without replay, rollback, or access boundaries: Delta CDF reads _change_type, _commit_version, and _commit_timestamp from version 41 to 45; the target marks a 3-state upsert by source primary key and commits offset 45 only after MERGE succeeds.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: A table-level ordered feed of row changes tied to transaction versions in formats or engines that support it.
  • What does the recovery plan do when this occurs? Starting from a CDF version without a complete bootstrap duplicates or misses rows, compaction/vacuum can remove required history, and an update row arriving twice produces duplicate effects if the sink is not idempotent.
  • When is CDF insufficient for Retention, and what does adding Incremental cost in Committed version?
Interview tip: Lead with the data path and failure boundary: A change data feed exposes row-level insert, update, and delete records between table versions so incremental consumers process only affected events while preserving table provenance. Then make the answer operational: Bootstrap into a reconciled snapshot, persist the last committed table version atomically with the sink, configure CDF/history retention to exceed backlog, dedupe by event/primary key, and replay bounded versions after failure.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Change Data Feed (CDF) & Incremental Lakehouse Processing with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
DuckDB + Iceberg / Delta Lake Local & Serverless Analytics
Next topic
Multi-Engine Read/Write Concurrency Control