CLOUD CONCEPT

Change Data Capture

Change Data Capture is a technique for detecting inserts, updates, and deletes in a source data store and making those changes available to downstream systems.

Cloud Concepts Hub →

What is Change Data Capture

Change Data Capture (CDC) lets systems process incremental changes instead of repeatedly copying an entire dataset. It supports low-downtime migrations, continuously updated analytics, and current search or vector indexes, while requiring careful handling of ordering, retries, deletions, and recovery.

Change Data Capture separates an initial dataset from the changes that occur afterward. A pipeline commonly loads a consistent snapshot, records an associated source position, and then processes subsequent inserts, updates, and deletes. Change records typically include a record identifier, operation type, and ordering or checkpoint information; before-and-after values depend on the source configuration. Coordinating the snapshot with the change stream prevents gaps or incorrect results while applications continue writing.

Common capture methods include reading database transaction logs, using database triggers, and querying for records modified after a stored watermark. Log-based capture can reduce repeated table scans, but requires engine-specific configuration, privileges, and sufficient log retention. Triggers add work to source transactions. Timestamp polling is simpler in some environments, but needs reliable modification tracking, careful boundary handling, and a separate mechanism for hard deletes. Incremental polling does not necessarily preserve every intermediate change.

In cloud architectures, a capture component can publish changes to a durable stream, object storage, or a target database. Consumers then transform records and update analytical tables, caches, search indexes, or other derived stores. Choose streaming when freshness requirements justify continuously running infrastructure; use micro-batches or scheduled incremental processing when minutes or hours of delay are acceptable. CDC describes which changes are captured, not a guarantee of real-time processing or a particular ingestion frequency.

For a database migration, a typical approach is to convert incompatible schemas, perform a full load, and replicate ongoing changes until the target catches up. For example, a heterogeneous migration may require translating data types, stored procedures, and indexes separately from moving table data. Before cutover, validate the target, stop or redirect source writes, drain remaining changes, and confirm synchronization. CDC reduces the write interruption but does not automatically eliminate downtime or provide bidirectional conflict resolution. Compare ongoing replication costs with a simpler offline migration when downtime is acceptable.

For foundation-model augmentation, CDC can keep a vector store aligned with authoritative content. A consumer maps each changed document to stable document and chunk identifiers, regenerates embeddings for affected text, and upserts the resulting vectors. It must remove obsolete chunks when documents shrink and delete vectors when source documents are deleted. Metadata-only changes may not require new embeddings, but permission changes still require prompt propagation so retrieval does not expose unauthorized content. Model or chunking changes can require broader reindexing even when source data has not changed.

Design consumers for retries and duplicate delivery unless the entire pipeline provides stronger guarantees. Idempotent upserts, deletion handling, source-version checks, and checkpointing help prevent stale events from overwriting newer state. Ordering is often limited to a record or partition rather than the whole dataset, and a multi-row transaction may not be applied atomically downstream. Monitor end-to-end lag, failed events, throughput, and retained-log coverage. If an outage exceeds the available change history, rebuilding a snapshot may be necessary.

CDC is not a backup, a schema-conversion tool, or a synonym for file transfer. AWS Transfer Family can move files containing snapshots or exported change batches, but it does not itself discover database row changes. Protect capture credentials and change payloads because logs and before-images may contain sensitive values. Periodic reconciliation remains useful for detecting missed deletes, transformation defects, or drift that incremental processing alone does not reveal.

Key aspects of Change Data Capture

Reliable CDC combines incremental capture with coordinated initialization, replay-safe processing, explicit freshness targets, and complete downstream lifecycle handling.

Incremental change propagation

Process inserts, updates, and deletes instead of repeatedly scanning and transferring all source data. Savings depend on the change rate, capture overhead, and downstream processing costs.

Coordinated bootstrap and checkpoints

Align an initial snapshot with a durable change-stream position so writes during the load are not lost. Persist checkpoints and retain enough source history to recover from expected outages.

Capture-method trade-offs

Choose among transaction-log reading, triggers, and watermark-based polling according to source capabilities and operational constraints. Verify delete detection and whether intermediate changes must be preserved.

Replay-safe processing

Use stable keys, idempotent writes, and source-version comparisons to tolerate retries and duplicates. Do not assume global ordering or atomic application of source transactions across downstream systems.

Freshness matched to workload

Select continuous streaming, micro-batching, or scheduled consumption based on the allowed data staleness. Monitor end-to-end freshness rather than only whether the capture process is running.

Derived-data lifecycle management

Propagate deletions, permission changes, and obsolete-record cleanup to search and vector indexes. Combine incremental updates with reconciliation and planned rebuilds when transformations or embedding models change.

Cloud services for Change Data Capture

AWS DMS can capture changes from supported databases and deliver them to supported targets, including Kinesis Data Streams for custom processing. DynamoDB Streams provides a separate capture path for DynamoDB item changes. Lambda consumers can transform these events and update derived data in OpenSearch Service, invoking an embedding model when changed text requires new vectors. These are alternative capture paths, not a mandatory chain. Across either path, coordinate the initial load with ongoing events, preserve stable identifiers, handle retries and deletions, and monitor lag against retention limits and application freshness requirements.

Amazon Kinesis Data Streams image Amazon Kinesis Data Streams

Provides a durable streaming layer for change events emitted by supported producers, including AWS DMS for supported configurations. Partition keys influence ordering and workload distribution; the stream does not itself detect changes in an arbitrary database.

Open Amazon Kinesis Data Streams →
AWS Lambda image AWS Lambda

Processes change records from DynamoDB Streams or Kinesis Data Streams using event source mappings. Functions can transform records, apply idempotent updates, and coordinate downstream embedding work, with explicit retry and failure handling.

Open AWS Lambda →
Amazon OpenSearch Service image Amazon OpenSearch Service

Can serve as a downstream search and vector-search destination for CDC-driven indexing pipelines. Consumers must translate source changes into document upserts, deletions, metadata updates, and embedding regeneration where needed.

Open Amazon OpenSearch Service →