Skip to content

CDC: MongoDB to ClickHouse | Real-Time Replication Guide

Real-time Change Data Capture from MongoDB to ClickHouse with exactly-once delivery, order-token guards, and tombstone anti-resurrect protection.

Source: MongoDB. Destination: ClickHouse.

CDC apply: ReplacingMergeTree.

Sample config

yaml
skippr:
  workspace: cdc_mongodb_to_clickhouse
pipelines:
  cdc_mongodb_to_clickhouse:
    data_source: data_sources.source
    data_sink: data_sinks.warehouse
    cdc:
      default:
        business_key_columns:
          - id
data_sources:
  source:
    Mongodb:
      connection_string: "mongodb://user:${MONGO_PASSWORD}@host:27017/mydb"
      database: mydb
      collection: events
      cdc_mode: snapshot_then_cdc
data_sinks:
  warehouse:
    Clickhouse:
      url: "http://localhost:8123"
      database: default
      user: default

Environment

bash
export CLICKHOUSE_PASSWORD="mypassword"

Source connector: mongodb. Destination connector: clickhouse-warehouse.

See CDC overview.