What I noticed
While working with Connect CDC, I spent some time exploring before-value capture. It is not something I noticed at first, but once I enabled it and looked at the output, it changed how I think about CDC completely.
What it actually does
By default, CDC focuses on the final state of data. It captures inserts, updates, and deletes and applies the latest version to the target.
With before-value capture enabled, CDC can also send the value that existed before the change, along with the new value and the operation type.
So instead of just seeing the latest row, you see the change itself.
What this looks like
Without before-values:
With before-values:
- BEFORE salary = 15000
- AFTER salary = 20000
It turns a simple update into a clear change event.
Where this becomes useful
I found this especially useful in a few scenarios:
-
Change tracking
You can see exactly how data evolved, not just what it looks like now
-
Auditing
You can answer what changed, what the previous value was, and when it changed without relying on application logs
-
Debugging
When something looks wrong at the target, having both before and after values makes it much easier to trace
-
Data pipelines
Instead of pushing table state, you are pushing a sequence of changes over time
What to keep in mind
There are trade-offs:
- Before-values are not enabled by default
- Data volume increases because updates carry more information
- This can increase load on queues and apply processes
In practice, an update can result in more data moving through the pipeline, so it is something to plan for.
What changed for me
I used to think of CDC as a way to keep tables in sync.
After using before-value capture, it feels more like a change stream. You are not just moving data, you are tracking how it changes over time.
Takeaway
Before-value capture does not just enhance replication. It changes the role of CDC from syncing data to observing data changes.
Once I started looking at it that way, it opened up more use cases beyond simple replication.
Have you used before-values for auditing or troubleshooting in your setup?
------------------------------
Adhitya Maya
*Precisely Software Inc.
------------------------------