A while back I wrote about a broken window in a Salesforce pipeline: a delta extract that drifted, got fixed with a full snapshot, and then drifted again over twelve months because nobody had repaired the underlying thing. That post was about the culture of leaving known faults unrepaired.

This one is about the fault itself. I’ve since watched the same design turn up in other places, built by people who’d never met each other, and every one of them called it “CDC”.

It wasn’t. It was a delta. And the difference is the whole problem.



What a delta extract actually promises


The pattern is familiar enough that most of us have built it at least once. The source table has a last_modified column. Each run, you remember the high-water mark from the last run, pull every row with a timestamp after it, and merge those rows into your copy. Cheap, simple, and it reuses a column the source already maintains.

Here’s the promise that this design makes:

Every change I care about bumps last_modified on the row I’m reading. The clock that sets it only moves forward, in one timezone. Rows are never physically deleted. And no row ever commits with a timestamp earlier than one I’ve already seen.

I have never worked with a source system where all four were true.

So before I build one of these now, I ask the source team a few awkward questions:

  • What happens when someone deletes a record?
  • Can anything change a row without touching last_modified: a system job, a migration, a vendor patch?
  • Can history be corrected after the fact, with a back-dated change?
  • Does the table keep every version, or only the latest state?

Every “it depends” is a place where drift will start. When it does, the delta extract won’t have failed. It’ll have done precisely what it promised.

Vu Trinh’s introduction to CDC lists timestamp polling as the first of three approaches, alongside triggers and log reading, and gives it the fair summary: easiest to build, can’t see deletes, loads the source, freshness bounded by the poll. I’d add one thing to that list, Timestamp polling can only see changes that the source chose to timestamp.



The Salesforce version of the problem


Salesforce is a good teaching case because it breaks the promise in four separate, well-documented ways, and because nearly every enterprise data team has a Salesforce feed.

Related-object updates don’t touch the parent. Change a Contact and the Account it hangs off doesn’t get a new LastModifiedDate. If your downstream model of “account” is denormalised from both, your account copy is now stale and your delta logic has no idea. The same applies to roll-up summary fields recalculated by a child insert: the number on the parent changes, the parent’s timestamp may not.

Hard deletes are invisible. A delta query asks “what changed since X?” A deleted row isn’t in the result set, because it isn’t in the table. Salesforce does keep a recycle bin and exposes IsDeleted through queryAll, but only for a limited window, and only if you remembered to ask. Most timestamp extracts don’t. Fifteen days later the record is gone from the source and immortal in your warehouse.

Bulk operations and backfills land out of order. Data loads, Apex triggers, integration users and admins running mass updates can all commit rows whose LastModifiedDate is before your high-water mark. Formula field changes, which update every row’s computed value without touching LastModifiedDate at all, are the extreme case: the whole table changed and nothing bumped.

SystemModstamp and LastModifiedDate disagree. SystemModstamp moves when automated processes touch a record; LastModifiedDate only moves when a user or integration edits it. Pick the wrong one and you miss an entire class of change. Pick the right one and you still miss the previous three.

That’s not a Salesforce bug. Inside Salesforce, “last modified” just means something different from what your pipeline needs it to mean.



Why the drift is invisible until it isn’t


The nasty property of timestamp deltas is that every failure mode produces a plausible-looking table. Nothing errors. Row counts go up. Freshness checks pass, because the rows that did arrive are fresh. The warehouse holds a record for every customer; it’s just that some fraction of them describe a state the source left behind months ago, and nobody can say which fraction.

In the Broken Window case the symptom finally surfaced downstream as a number that looked wrong in a report. The investigation walked back up the lineage, found the delta logic, ran a full snapshot, and the drift reset to zero. Then the clock started again.

A full snapshot is the correct remediation for a delta that has drifted. It is also an admission that the delta can’t be trusted, which is the point. If you have to periodically throw away the incremental state and reload from scratch to stay correct, you don’t have change data capture. You have a slow full load with a fast cache in front of it.

I don’t mean that as a dismissal. In most of the areas I work with, a full refresh is just easier. You get the right answer every time, and you don’t have to keep going back to the team that owns the source, or patching code, to chase why the numbers moved. What it isn’t is cheap: on a big table you pay for it in runtime and bandwidth, every run.



What CDC actually means


Change data capture, in the sense that the name was coined for, reads the database’s own record of what happened: the write-ahead log in Postgres, the binlog in MySQL, the redo log in Oracle, the CHANGES stream in Snowflake. Every insert, update and delete is there, in commit order, whether or not anyone bumped a timestamp, because the database could not have committed the change without writing it.

That gives you the four clauses for free. Related-object updates? Each is its own row-level event. Deletes? An event with the before-image. Out-of-order commits? The log is the order. Formula recalculations? If they wrote to disk, they’re in the log; if they didn’t, your source doesn’t physically store them either and no extract method would have found them.

The cost is plumbing, and Vu Trinh is right not to wave that away. Log-based CDC means logical replication permissions, a connector such as Debezium, a broker or stream to carry events, offset management so a restart doesn’t skip or double-apply, an initial snapshot so the destination starts consistent, and a plan for schema evolution at the destination end. That’s half a dozen moving parts where the timestamp query had one.



What it looks like when a team commits to it


WHOOP recently published a description of their CDC platform, and it’s worth reading because it comes from the people who run it: a mid-sized engineering org replicating hundreds of Postgres tables and describing what it took.

The shape: one Debezium connector per Postgres database, reading logical replication publications. Avro events into Kafka, one topic per table. Flink writes an append-only bronze layer to Iceberg. Spark merges that into silver, the materialised replica, every four hours. Snowflake reads the Iceberg tables.

Three details stood out to me.

Ownership sits with the source team. Service teams add tables to the publication through their own Liquibase migrations and configure connectors through a Terraform module. The data platform team owns the Flink and Spark jobs. A new table shows up in bronze within about a minute of the topic appearing, without anyone from the platform team touching it. That’s the self-service part, and it’s an organisational decision as much as a technical one.

Deletes are just another event. A delete arrives as cdc_op = 'd' and goes through the same MERGE INTO as an update. The whole class of “immortal rows” simply doesn’t exist in that design.

The snapshot problem is handled explicitly. Bootstrapping a new table uses an Aurora snapshot exported to Parquet, and if the snapshot predates the moment the table joined the publication, the backfill waits for a newer one rather than risk a gap.

They also made the trade-off I’d make: silver refreshes every four hours, not every thirty minutes, because continuous upserts were the dominant cost and almost nobody needed the freshness. Consumers who do can read bronze.



Choosing honestly


I’m not going to tell you to rip out your timestamp extracts. Most of mine are still running. What I will say is that the choice should be made on purpose.

Timestamp deltas are a reasonable design when all of the following hold:

  • The source is append-mostly and soft-deletes, or you genuinely don’t care about deletes.
  • Every write path that matters sets the timestamp, and you’ve checked rather than assumed.
  • You can afford a periodic full reload, and you’ve scheduled it, and it isn’t a “workaround” filed in a ticket.
  • Nobody downstream is going to build a regulatory report on the assumption that the copy is complete.

Log-based CDC is worth the plumbing when any of those fail, and especially when the source is the system of record for something that gets audited. If someone is going to ask “was this row deleted, and when?”, a delta can’t answer and a log can.

There’s a middle path that’s often the pragmatic answer for SaaS sources like Salesforce, where you can’t read the log anyway: use the platform’s change API where it exists (Salesforce has Change Data Capture events and Platform Events; most modern SaaS tools have something similar), or let a managed connector carry the burden. Just check what the API actually guarantees before you lean on it. Salesforce’s CDC events are only replayable for about three days, so a connector that’s down over a long weekend has the same gap problem in a new costume.



The tradeoff


The honest comparison is “cheap to build and expensive to trust” against “expensive to build and cheap to trust”.

A delta extract moves the cost from the start of the pipeline’s life to the middle of it, and spreads it out so thinly that it never shows up as a line item. It shows up as a drift investigation every year or so, a full reload nobody budgeted for, and one awkward meeting where a report number doesn’t match the source. Log-based CDC takes the cost up front, in infrastructure and in a team that has to learn to run it.

Neither is wrong. But only one of them should be allowed to call itself change data capture, and if your pipeline is the other one, the kindest thing you can do for the engineer who inherits it is to say so in the README.