Production-ready change data capture pipeline for Databricks β Debezium parsing, MERGE INTO application, offset management, and replication monitoring.
By Datanest Digital | Version 1.0.0 | $49
MERGE INTO with full operation type supportcdc-replication-toolkit/
βββ README.md
βββ manifest.json
βββ LICENSE
βββ src/
β βββ cdc_processor.py # CDC event processing engine
β βββ debezium_parser.py # Debezium JSON format parser
β βββ merge_applier.py # MERGE INTO change application
β βββ offset_manager.py # Kafka offset & LSN tracking
β βββ schema_mapper.py # Sourceβtarget schema mapping
β βββ replication_monitor.py # Lag, throughput, error monitoring
βββ configs/
β βββ replication_config.yaml # Main replication configuration
β βββ source_mappings/
β βββ postgres_to_delta.yaml # PostgreSQL type mappings
β βββ mysql_to_delta.yaml # MySQL type mappings
β βββ sqlserver_to_delta.yaml # SQL Server type mappings
βββ notebooks/
β βββ start_replication.py # Start CDC streaming pipeline
β βββ replication_status.py # Replication status dashboard
βββ tests/
β βββ conftest.py # Shared fixtures
β βββ test_cdc_processor.py # CDC processing tests
β βββ test_debezium_parser.py # Debezium parsing tests
βββ guides/
βββ cdc-replication-guide.md # CDC patterns & Debezium guide
Follow this guide to get cdc replication toolkit up and running in your environment.
Edit configs/replication_config.yaml with your source database and Kafka settings:
source:
type: postgres
kafka_bootstrap_servers: "broker1:9092,broker2:9092"
topic_prefix: "dbserver1"
tables:
- "public.orders"
- "public.customers"from src.cdc_processor import CDCProcessor
processor = CDCProcessor(config_path="configs/replication_config.yaml")
processor.start_streaming() # Starts structured streaming with checkpointsfrom src.debezium_parser import DebeziumParser
from src.merge_applier import MergeApplier
parser = DebeziumParser()
events = parser.parse_stream(raw_kafka_df)
applier = MergeApplier(target_table="main.bronze.orders", key_columns=["id"])
applier.apply_changes(events)from src.replication_monitor import ReplicationMonitor
monitor = ReplicationMonitor(config_path="configs/replication_config.yaml")
status = monitor.get_replication_status()
print(f"Lag: {status.lag_seconds}s | Throughput: {status.events_per_second}/s")ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
β Source DB βββββΆβ Debezium βββββΆβ Kafka Topics β
β (PG/MySQL/ β β Connector β β (CDC events) β
β SQL Server)β ββββββββββββββββ ββββββββββ¬ββββββββββ
ββββββββββββββββ β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Databricks β
β βββββββββββββββ ββββββββββββββββ βββββββββββββββββββββ β
β β Debezium βββΆβ CDC βββΆβ Merge Applier β β
β β Parser β β Processor β β (MERGE INTO) β β
β βββββββββββββββ ββββββββ¬ββββββββ βββββββββββββββββββββ β
β β β
β βββββββββββββββ ββββββββ΄ββββββββ βββββββββββββββββββββ β
β β Schema β β Offset β β Replication β β
β β Mapper β β Manager β β Monitor β β
β βββββββββββββββ ββββββββββββββββ βββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Get the full CDC Replication Toolkit and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.