-
This project demonstrates a log-based Change Data Capture (CDC) workflow in a homogeneous PostgreSQL environment, using Debezium, Docker, and dlt to consume change events.
-
The goal of this experimentation is to configure CDC via Debezium, simulate database changes, and observe how those changes are captured and consumed by dlt in Python.
-
The test_mock_data.py script is used to simulate inserts, updates, and deletes on the source PostgreSQL database defined in docker-compose.yaml.
To enable PostgreSQL logical replication (transaction logs), see this configuration in this line on the docker-compose.yaml.
Make sure Docker is installed and then run:
docker compose up -dThis will start the necessary containers: PostgreSQL, Kafka + Zookeeper (used by Debezium), and Debezium connectors.
You’ll need psycopg to run the mock data script:
pip install psycopgRun the script to insert, update, and delete rows in the source PostgreSQL database:
python3 ./test_mock_data.pyThis will generate mock events that Debezium will capture and stream to DLT.