liveBook · Manning

Snapshot-based replication

As explained in Kafka for Architects

Snapshot-based replication copies the current state of a source dataset to another system rather than replaying each individual change.

Snapshot-based replication transfers a source dataset's current state to another system instead of emitting every insertion, update, and deletion as a separate change event. section 5.1.2

It fits reference data such as occupations, education levels, marital status, and country codes when values are static or change infrequently. Kafka Connect provides a configuration-driven alternative to custom update services. section 5.1.2

A typical replication flow:

  • A source connector reads the current state, such as through a JDBC Source Connector, and writes records to Kafka topics. section 5.1.2
  • Independent sink connectors consume those topics and write the data to target systems. section 5.1.2
  • Use CDC instead when every source change must be captured from change logs. section 5.1.2
Figure 5.3 Setting up Kafka Connect for data replication involves using PostgreSQL and MongoDB as source systems. Source connectors are responsible for pulling data from these systems and inserting it into Kafka topics. In turn, sink connectors pull the data from Kafka and insert it into the target systems. In this setup, both sink connectors consume data from the same topics, with one inserting the data into an MS SQL database and the other into Amazon S3.
A diagram of a software system

AI-generated content may be incorrect.

Shows PostgreSQL and MongoDB sources feeding Kafka topics, with independent sinks delivering data to MS SQL and Amazon S3. section 5.1.2

How Kafka for Architects covers it

How deep it goes
Contrasts current-state reads with CDC and outlines connector flow, but stops short of detailed configuration.
Examples
Uses occupation, education, marital-status, country-code, PostgreSQL, MongoDB, MS SQL, and Amazon S3 data examples.
What it assumes
Requires a Kafka Connect cluster with appropriate plugins for participating source and destination systems.
What you can do after
Operate Kafka Connect replication using configured source and sink connectors instead of specialized update services.
How it connects
Connects snapshot replication with Kafka Connect, Kafka topics, source connectors, sink connectors, JDBC, and CDC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.