# What your CDC pipeline does when a primary key changes

DevFeed: [What your CDC pipeline does when a primary key changes](<https://devfeed.tech/articles/what-your-cdc-pipeline-does-when-a-primary-key-changes-121702.md>)

Original publisher: [Read original article](<https://estuary.dev/blog/cdc-primary-key-changes>)

Author: Dani Pálma

Published: 2026-11-06T05:20:53Z

Content type: article

Language: en

Sources: [Estuary](<https://devfeed.tech/sources/estuary.md>)

Topics: [Debezium Connector](<https://devfeed.tech/topics/debezium-connector.md>), [Analytics Pipeline](<https://devfeed.tech/topics/analytics-pipeline.md>)

Tags: [cdc](<https://devfeed.tech/tags/cdc.md>), [cdc-tools](<https://devfeed.tech/tags/cdc-tools.md>), [change-data-capture](<https://devfeed.tech/tags/change-data-capture.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [data-privacy](<https://devfeed.tech/tags/data-privacy.md>), [database](<https://devfeed.tech/tags/database.md>), [debezium](<https://devfeed.tech/tags/debezium.md>), [delete](<https://devfeed.tech/tags/delete.md>), [docs](<https://devfeed.tech/tags/docs.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [estuary](<https://devfeed.tech/tags/estuary.md>), [key](<https://devfeed.tech/tags/key.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [tests](<https://devfeed.tech/tags/tests.md>), [updates](<https://devfeed.tech/tags/updates.md>)

## AI overview

A CDC pipeline can silently retain a stale row when a primary key changes: the connector must emit a delete for the old key, and the destination must apply it. In tests with MySQL, Debezium 3.0.8's JDBC sink left orphans with its default delete.enabled=false; enabling deletes matched the source. Estuary's MySQL capture handled the tested key changes with both soft-delete and hard-delete Postgres materializations; soft-deleted rows remain stored and must be filtered from live results. FULL row images provide old and new values but add log data, and correctness still depends on connector and sink behavior. To check a pipeline, update a key in staging, compare destination rows with source IDs, then test key swaps and reuse. The text also cautions that incomplete or ambiguous old keys may prevent a safe delete, and before-images can expose sensitive data.

## Source excerpt

A hands-on look at how CDC pipelines handle primary key updates, deletes, and orphan rows, with tests using MySQL, Debezium, and Estuary.