Change data capture
Change data capture (CDC) is a method of detecting inserts, updates and deletes in a source database and streaming only those changes to other systems.
Also called: CDC, log-based CDC, incremental replication, database replication
Change data capture, or CDC, is a technique that detects every insert, update and delete in a source database and sends only those changes downstream, instead of copying whole tables over and over. For GTM teams it is how product events like a signup, plan upgrade or usage spike reach the warehouse, CRM or routing logic within seconds or minutes rather than the next morning.
How it works
There are three common approaches, from crude to precise.
Full refresh is not really CDC: you copy the entire table on a schedule and replace the old copy. It is simple and wasteful, and it gets slower as tables grow.
Query-based CDC (sometimes called incremental sync) asks the database for rows where updated_at > last_sync_time. It is easy to set up but misses hard deletes, depends on every table having a reliable timestamp, and adds query load to production.
Log-based CDC reads the database's own transaction log, the write-ahead log in Postgres or the binlog in MySQL, and converts each entry into an event like {op: "update", table: "accounts", before: {...}, after: {...}}. It catches deletes, preserves the order of changes and barely touches the production database. Debezium is the best known open-source engine. Managed ingestion tools such as Fivetran and Airbyte offer log-based connectors, and warehouses increasingly provide native options.
Downstream, the events land in a stream or a staging table, and a merge step applies them to the target. Because the same event can arrive twice after a retry, the merge must be idempotent: applying a change twice should leave the same result as applying it once.
Example
Say a self-serve product has an accounts table with 2 million rows, and about 20,000 rows change per day (assumption). A nightly full refresh moves 2 million rows every run. Query-based sync moves 20,000 rows but misses the roughly 300 daily deletes, so churned workspaces linger in reporting.
Log-based CDC moves those 20,000 changes plus the 300 deletes, continuously. The data volume drops by about 99% versus full refresh (20,000 divided by 2,000,000 is 1%), which usually lowers both connector costs priced by rows and warehouse compute.
Now the GTM payoff. When an account crosses 10 active seats, a CDC event lands in the warehouse within a few minutes, a model flags it, and a webhook creates a task for the account owner. Compare that with a nightly batch, where the rep hears about it 12 to 24 hours later. For expansion and speed-to-lead plays, that gap matters.
When it matters and when it doesn't
CDC earns its complexity in three situations: your product database holds the signals sales acts on, tables are large enough that full refreshes are slow or expensive, or deletes need to propagate accurately for billing and compliance reasons.
It does not matter for weekly board reporting, small SaaS apps with a few thousand rows, or sources that already push events through an API. In those cases, a scheduled sync with a sensible data freshness target is fine. Our rule of thumb: decide the freshness the business decision actually needs, in minutes or hours, then pick the cheapest method that meets it. CDC often pairs naturally with an event-driven architecture, where downstream services react to changes rather than polling for them.
Common mistakes
- Enabling CDC on a production database without coordinating with engineering on log retention and replication slots, which can fill disks if the consumer falls behind.
- Assuming query-based sync captures deletes.
- Streaming every table when only three tables drive GTM decisions.
- Forgetting schema changes: a renamed column upstream can break the consumer silently.
- Non-idempotent merges that double count rows after a connector restarts.
FAQ
How does log-based change data capture work?
Databases write every change to an internal log before applying it, such as the write-ahead log in Postgres or the binlog in MySQL. Log-based CDC reads that log and turns each entry into an insert, update or delete event. It catches deletes and puts very little load on the production database.
Is change data capture the same as real-time sync?
Not exactly. CDC is the technique for detecting changes, and it can feed a real-time stream or a micro-batch that runs every few minutes. Real-time sync is an outcome, and CDC is one of the most reliable ways to get there from a database.
When should a GTM team use change data capture?
Use it when your product database is the source of important GTM signals, like signups, upgrades or usage thresholds, and someone needs to act on them within minutes. For nightly reporting, a scheduled incremental sync is usually cheaper and simpler.