agentleFS
vaquarkhanvaquarkhan/data-engineering-agent-skills/skills/debezium-and-kafka-connect-cdc/SKILL.md

debezium-and-kafka-connect-cdc

Skill49 starsChanged 6 months agoMITView on GitHub

Guides agents through Debezium and Kafka Connect CDC workflows. Use when streaming database changes into Kafka topics, managing connectors, snapshots, schema evolution, or downstream CDC consumers.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when database changes must be captured and delivered through Debezium and Kafka Connect.

    line 10
  2. Distinctive:

    Do not use this when changes can be captured through application-level events or batch extracts are sufficient for freshness requirements.

    line 20
  3. Distinctive:

    document what happens if a snapshot is interrupted

    line 37
  4. Distinctive:

    document which consumers depend on each topic

    line 51
  5. Distinctive:

    test that downstream consumers handle schema changes without failure

    line 56
  6. Distinctive:

    document re-snapshot procedure for recovery

    line 61
  7. Distinctive:

    no monitoring of connector lag or WAL/binlog retention

    line 76
  8. Distinctive:

    no schema registry integration for CDC topics

    line 78
  9. Distinctive:

    no documented recovery procedure for slot loss or binlog expiry

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debezium And Kafka Connect CDC

Overview

Use this skill when database changes must be captured and delivered through Debezium and Kafka Connect. It helps agents define connector safety, snapshot behavior, schema handling, and downstream CDC contracts.

When to Use

  • setting up Debezium connectors for PostgreSQL, MySQL, MongoDB, SQL Server, or Oracle
  • designing Kafka-based CDC from transactional databases
  • handling initial snapshots, incremental streaming, and connector recovery
  • feeding downstream stream processors, lakehouse sinks, or search indexes
  • managing schema evolution when source tables change

Do not use this when changes can be captured through application-level events or batch extracts are sufficient for freshness requirements.

Workflow

  1. Define source tables, keys, and change event semantics. Include:
    • which tables to capture and which to exclude
    • primary key and unique key strategy for each table
    • expected change operations: inserts, updates, deletes, truncates
    • whether tombstone records are needed for compacted topics
    • expected change volume and peak throughput
  2. Plan snapshot behavior explicitly.
    • initial snapshot: full table scan on first connector start
    • define snapshot mode: initial, schema_only, never, or when_needed
    • understand lock behavior during snapshot (especially for PostgreSQL and MySQL)
    • plan for snapshot duration on large tables — can take hours
    • document what happens if a snapshot is interrupted
  3. Configure connector for operational resilience.
    • set appropriate max.batch.size and poll.interval.ms
    • configure heartbeat intervals to prevent WAL/binlog retention issues
    • define slot or binlog retention policies on the source database
    • plan for connector task failures and automatic restarts
    • monitor connector lag and offset position
  4. Define topic contracts and downstream expectations.
    • topic naming convention: {prefix}.{schema}.{table}
    • event envelope format: include before/after, operation type, source metadata
    • schema registry integration for event contracts
    • retention and compaction policy per topic
    • document which consumers depend on each topic
  5. Handle schema evolution safely.
    • source DDL changes (column adds, renames, type changes) propagate through CDC
    • define compatibility policy in schema registry (backward, forward, full)
    • test that downstream consumers handle schema changes without failure
    • plan for breaking changes: connector restart, re-snapshot, or topic migration
  6. Plan recovery, replay, and operational safety.
    • define what happens when the connector falls too far behind (slot overflow, binlog expiry)
    • document re-snapshot procedure for recovery
    • plan for database failover: does the connector reconnect automatically?
    • define monitoring alerts: lag, errors, rebalances, and dead-letter routing

Common Rationalizations

RationalizationReality
"CDC is just a connector — set it and forget it."Connectors require active monitoring, offset management, and schema evolution handling. Neglected connectors silently lose data.
"We don't need to worry about snapshots after the first one."Database failovers, slot loss, and connector resets can trigger re-snapshots. The team must plan for snapshot impact on source load.
"Schema changes in the source don't affect CDC."Every DDL change propagates through the CDC stream. Without compatibility policies, downstream consumers break silently.
"Kafka handles deduplication for us."Debezium provides at-least-once delivery. Consumers must handle duplicates or use idempotent processing patterns.

Red Flags

  • no monitoring of connector lag or WAL/binlog retention
  • snapshot mode is undefined or set to always without understanding impact
  • no schema registry integration for CDC topics
  • downstream consumers assume exactly-once delivery without deduplication logic
  • heartbeat intervals are not configured, risking WAL bloat on the source
  • no documented recovery procedure for slot loss or binlog expiry
  • topic retention is unlimited with no compaction policy
  • connector runs with a single task on high-volume multi-table sources

Verification

  • Source tables, keys, and change semantics are explicitly documented
  • Snapshot behavior and impact on source database are understood and planned
  • Topic contracts include naming, envelope format, retention, and schema compatibility
  • Schema evolution paths are tested for both additive and breaking changes
  • Connector monitoring covers lag, errors, rebalances, and offset position
  • Recovery procedures for slot loss, binlog expiry, and database failover are documented
  • Downstream consumers handle at-least-once delivery with deduplication or idempotency

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.