Change data capture

Change data capture (CDC) captures the changes in a source system, and applies them to a downstream system or application.

The usual way of capturing changes from a database uses Debezium with Kafka Connect. Debezium reads every row-level change of each table, in the order in which the changes happened, and writes them to a Kafka topic. Other systems read the topic.

In Cloudera Streaming Analytics, the CDC connectors run inside Flink, and they do not need Kafka or Kafka Connect. The connectors read the change log of the database directly, and Flink propagates the changes to any connector that Flink supports. You can run queries on the change stream while it arrives from the database, for example to filter, group, or join it.

A CDC source first reads a snapshot of the table, and then it continues with the changes. Each change is a row with an operation type. The table behaves like a changelog table, which means that an update or a delete of a row is part of the stream. A query on a CDC table can therefore produce updates, and its sink must be able to process them. To write the result to Kafka, use the upsert-kafka type. For more information, see Kafka connector.

The engine includes CDC sources for MySQL, PostgreSQL, Oracle, Db2, and SQL Server. For the properties and the database prerequisites, see CDC connectors.