Configuring Debezium to Capture PostgreSQL Changes with Docker Compose
Capture change events from PostgreSQL with Debezium deployed on Docker Compose
Published in
5 min readAug 10, 2021
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:
- You are familiar with the PostgreSQL database and Debezium.
- You have hands-on experience with Docker Compose.
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) | | |…