Configuring Debezium to Capture PostgreSQL Changes with Docker Compose

Capture change events from PostgreSQL with Debezium deployed on Docker Compose

Dunith Danushka
Tributary Data

--

Photo by Roxanne Desgagnés on Unsplash

In this tutorial, you will learn how to deploy a Postgres Docker image that can be used with Debezium for change data capture (CDC). Captured changes are then written to a Kafka topic. Later, we will use the kafkacat utility to examine the content of that topic.

The tutorial assumes:

The scenario

Let’s take a simple use case and build our project around it.

Imagine we have a shipments database in Postgres that keeps track of order shipments. It has the shipments table in the following format.

shipment_db=# \d shipments;
Table "public.shipments"
Column | Type | Collation | Nullable | Default
--------------+------------------------+-----------+----------+---------
shipment_id | bigint | | not null |
order_id | bigint | | not null |
date_created | character varying(255) | | |…

--

--

Dunith Danushka
Tributary Data

Editor of Tributary Data. Technologist, Writer, Senior Developer Advocate at Redpanda. Opinions are my own.