Skip to content

MongoDB CDC to ClickHouse Final-State Guide

June 2026

MongoDB to ClickHouse CDC is about document identity, change-stream resume, and knowing when ClickHouse has converged.

Short Answer

MongoDB CDC reaches ClickHouse by combining change-stream document mutations with ReplacingMergeTree reconciliation. Skippr reads insert, update, and delete operations from the change stream, carries forward the full document after image for updates, and inserts versioned rows into ClickHouse so newer document versions win during merges.

The destination-specific trade-off is visibility before convergence. A document update might produce both the older and newer row versions temporarily until ClickHouse merges them. For teams that need immediate point-in-time correctness on fresh data, FINAL is part of the query contract.

Why Teams Struggle with This

This integration often feels natural because both systems can handle large mutable datasets. The catch is that they expose correctness differently.

  • MongoDB requires a replica set or sharded cluster for change streams.
  • Resume tokens need to be preserved or restarts become unsafe.
  • Document identity, usually _id, must become the ClickHouse business key.
  • Readers need to know that ReplacingMergeTree converges over background merges, not instantly.

How Skippr Handles It

Skippr keeps the source side faithful to MongoDB semantics by using change streams, storing resume tokens, and using fullDocument updateLookup so update events arrive as useful after images.

For ClickHouse, Skippr adds _skippr_order_token, uses ReplacingMergeTree to retain the newest document version, and records deletes in tombstone tables. That gives the pipeline a clear rule for convergence and delete safety.

  • Change-stream resume tokens preserve restart position.
  • Update events carry full document after images for warehouse reconciliation.
  • ReplacingMergeTree keeps the row with the highest version during merges.
  • FINAL remains the read-time option for immediate correctness.

What the First Useful Version Looks Like

Choose this setup when MongoDB feeds a ClickHouse analytics surface and the team is comfortable with ClickHouse merge semantics.

The integration works best when document identity and read-time expectations are documented just as clearly as the ingestion setup.