Learn Everything

Paths/Data Engineer/Change Data Capture / Reading the Log

Guided Taskbeginnerubuntu:24.04Ask AI

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

⏱ 0:00

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
  1. 01

    Create the cdc directory

    One directory holds the whole capture configuration.

    mkdir -p ~/cdc
  2. 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
  3. 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
  4. 04

    Verify and submit

    cat the configuration, then submit for validation.

    cat ~/cdc/config.yaml

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list