Paths/Data Engineer/Change Data Capture / Reading the Log
Configure the Replication Slot
The slot is a place in the write-ahead log that a reader can follow. Write the configuration that points it at your tables.
Validator
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- Directory ~/cdc exists○
- File ~/cdc/config.yaml exists○
- The config names the publication and the slot○
- The config states the replica identity setting○
02Walkthrough
4 steps- 01
Create the cdc directory
One directory holds the whole capture configuration.
mkdir -p ~/cdc - 02
Write the slot and publication
The slot is a named position in the log. The publication lists the tables whose changes you want.
echo 'cdc:\n slot: orders_slot\n publication:\n name: orders_pub\n tables: [public.orders, public.order_items]' > ~/cdc/config.yaml - 03
State the replica identity setting
REPLICA IDENTITY FULL is what makes an update carry the whole row instead of just the key. It costs write volume, so use it per table, not per database.
echo '\n replica_identity: "REPLICA IDENTITY FULL"\n snapshot_mode: initial\n parallel_workers: 4' >> ~/cdc/config.yaml - 04
Verify and submit
cat the configuration, then submit for validation.
cat ~/cdc/config.yaml
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list