CDC to ClickHouse: Debezium, Airbyte, ClickPipes, and the trade-offs
Three replication paths from Postgres/MySQL into ClickHouse, three sets of failure modes. This is the honest playbook - latency, ordering, schema evolution, and the one gotcha nobody warns you about.
Change-data-capture into ClickHouse is one of those problems that looks solved in a demo and turns brittle in production. The demo runs on a table with 10k rows, no schema evolution, and a source database whose write rate fits comfortably inside the replication slot. Production has a hot table doing 20k writes a second, a schema that evolves twice a week, and a network partition every third Tuesday.
The three names that dominate the CDC-to-ClickHouse conversation in 2026 are Debezium, Airbyte, and ClickPipes. They occupy different points on the same trade-off surface: latency, ordering, schema evolution, and operational cost. None of them are wrong; all of them have a shape of workload they fit and a shape they do not.
This post walks the three paths, then covers the gotcha that costs teams weeks: ClickHouse does not update rows the way Postgres does, and the pattern you use to reconcile that difference is the single most consequential decision on a CDC pipeline.
What CDC is, and why into ClickHouse
Change-data-capture reads the write-ahead log of an OLTP database (Postgres WAL, MySQL binlog, SQL Server transaction log) and produces a stream of insert / update / delete events downstream. It is different from batch ELT in one important way: it captures every change, in order, as it happens, rather than diffing a snapshot on a schedule.
Into ClickHouse specifically, CDC is what you reach for when the analytical query needs data that is minutes-fresh, not hours-fresh, and when the source table is too large or too write-heavy to re-scan on every batch. ClickHouse is a columnar analytical store; the OLTP source is where the transactions actually happen. CDC is the bridge.
The reason it is not trivial is that ClickHouse’s MergeTree family was designed for insert-heavy, update-rare workloads. Every row you write is an insert. Deletes and updates require the engine to reconcile older rows against newer ones at query time or at merge time, and the pattern for that reconciliation is not automatic. More on that later.
Path 1: Debezium
Debezium is the OSS reference implementation of CDC. It runs as a Kafka Connect source, reads the source database’s replication log, and produces one Kafka topic per source table. Everything downstream of that is Kafka - which means a sink connector, a stream processor, or a consumer written by hand.
Latency. With a well-tuned Kafka Connect deployment and a Kafka-to-ClickHouse sink (the official ClickHouse Kafka Connect Sink or a Kafka Connect JDBC variant), p50 latency lands in the 1-5 second range. p99 is dominated by tail behaviour of the Kafka broker and the sink batch interval, and lands in the 10-30 second range for a healthy cluster. If your sink’s flush.size is large or flush.interval.ms is set for throughput, p99 climbs.
Ordering. Debezium is at-least-once by default. Exactly-once semantics exist in Kafka Connect via idempotent producers plus transactional consumers, but you have to configure them explicitly, and the ClickHouse sink must be idempotent on its own side (typically by keying on the source primary key plus a version column). Per-partition ordering is preserved; cross-partition ordering is not, and if you re-partition a Kafka topic by a non-primary-key you will lose it.
Schema evolution. Debezium detects DDL on the source and emits schema-change events into a separate topic. Whether they propagate downstream depends on your sink connector: the ClickHouse Kafka Connect Sink will auto-add columns if configured, but type changes (widening an int to a bigint, changing varchar length, adding a nullable) require intervention. Drops are the hardest case, and most teams handle them manually.
Operational cost. This is the most expensive of the three to run yourself. You are running Kafka, Kafka Connect, Debezium, Schema Registry (usually), and the ClickHouse sink. Two or three FTEs of platform-engineering time to stand up, and a permanent slice of one FTE to keep green. Hosted alternatives (Aiven, Confluent Cloud, Redpanda Cloud with Redpanda Connect) turn this into a monthly bill; for a mid-sized workload that is $1500 to $6000 a month plus data-transfer.
Debezium wins when you already run Kafka, when your CDC needs to fan out to multiple destinations (a data warehouse plus a search index plus a cache), and when you need the ordering guarantees Kafka gives you at the topic level. See the Debezium docs for the connector matrix and the tuning parameters that actually matter.
Path 2: Airbyte
Airbyte’s CDC story is the Debezium engine embedded inside the Airbyte source connector. It is not a separate architecture; it is Debezium running as a library inside an Airbyte worker, writing to a state store, and letting Airbyte’s destination connectors take care of the load into ClickHouse.
Latency. Airbyte runs sync jobs on a schedule, not as a continuous stream. The minimum sync frequency on Airbyte Cloud is 5 minutes; on self-hosted Airbyte you can push it lower, but the framework was not built for sub-minute intervals. p50 latency is the sync interval plus the batch load time, so 5-10 minutes typical, 30 minutes at p99 for larger tables.
Ordering. Per-sync, ordering is preserved. Across syncs, the write batch is applied atomically to the destination, but there is no exactly-once guarantee against a mid-batch failure; Airbyte replays from its checkpoint, which can produce duplicate rows in the destination if the destination is not idempotent. The ClickHouse destination connector uses a primary-key deduplication step to compensate.
Schema evolution. Airbyte’s schema propagation is opt-in per stream. The source schema is refreshed on every sync when auto-propagation is enabled, and Airbyte handles column adds and type widenings automatically for most destinations. ClickHouse specifically is more conservative: type changes trigger a re-sync of the affected table by default, which is the safe behaviour but not always the fast one.
Operational cost. Airbyte Cloud bills by credits; a mid-sized CDC workload lands in the $500 to $3000 a month range depending on how many rows change and how often. Self-hosted Airbyte on Kubernetes costs the underlying compute plus one FTE-quarter of standing-up-and-tuning effort. Cheaper than Debezium at the low end, comparable at the high end.
Airbyte wins when your CDC needs are batch-shaped rather than stream-shaped, when the 5-minute latency floor is acceptable, and when you value the connector catalog beyond CDC (you are also pulling from Salesforce, Stripe, and HubSpot, and you want one tool for all of it).
Path 3: ClickPipes
ClickPipes is ClickHouse Cloud’s managed ingestion service. It supports Kafka, Kinesis, S3, and Postgres CDC as sources, and it lands directly into ClickHouse Cloud tables with no separate sink layer to configure.
Latency. ClickPipes advertises “seconds to minutes.” In practice, p50 latency for Postgres CDC lands in the 5-15 second range for healthy workloads, with p99 in the 30-90 second range. The Kafka source path is tighter (p50 1-3 seconds) because it inherits Kafka’s own latency profile. If your source is Kinesis or S3, you are at the mercy of the source’s polling interval.
Ordering. At-least-once with primary-key deduplication on the ClickHouse side. ClickPipes uses ReplacingMergeTree with a version column under the hood (which we will get to in a moment), so the deduplication is table-native rather than pipeline-native. This is the same pattern you would use with any of the other paths; ClickPipes just does the plumbing for you.
Schema evolution. ClickPipes handles column adds automatically for the Postgres CDC source. Column drops and type changes require a pipe pause plus a manual re-align. In our experience the automatic behaviour is more conservative than Debezium’s, which is a safety trade-off in the direction most data teams want.
Operational cost. This is where ClickPipes wins on paper. It is a managed service inside ClickHouse Cloud, so there is no separate ingestion cluster to run, no Kafka to keep green, and no self-hosted Airbyte on Kubernetes to tune. Cost is bundled into ClickHouse Cloud’s compute-and-storage bill; there is no per-row line item. For teams already committed to ClickHouse Cloud, this is often the cheapest path.
ClickPipes wins when you are on ClickHouse Cloud, when your CDC needs are simple (one source, one destination, no fan-out), and when the value of operational simplicity beats the value of pipeline flexibility. It loses when you need to route the CDC stream to more than one destination or when you are not on ClickHouse Cloud (self-hosted ClickHouse does not get ClickPipes).
Decision framework
The picking question is not “which is best.” It is “which shape of team, which shape of workload, which shape of destination.”
- On ClickHouse Cloud, one destination, simple CDC. ClickPipes. It exists to remove the operational surface area.
- Multiple destinations, Kafka already in the stack, need sub-second latency. Debezium. Nothing else gets you there.
- Batch-shaped CDC, 5-minute floor acceptable, want one tool for CDC and for SaaS ELT. Airbyte.
- Self-hosted ClickHouse, need CDC, do not want to run Kafka. Airbyte self-hosted is the least-worst path, but consider whether the CDC requirement is real or whether hourly batch would do.
The gotcha that costs teams weeks
ClickHouse’s MergeTree engine does not have UPDATE-in-place semantics the way Postgres does. Every insert is a new row on disk. When your CDC pipeline receives an update event from Postgres, it lands in ClickHouse as a new row alongside the old one, not a mutation of the old row. If you do nothing to reconcile them, SELECT * FROM orders WHERE order_id = 42 returns two rows: the old state and the new state.
The canonical fix is ReplacingMergeTree with a version column. You declare the table with ENGINE = ReplacingMergeTree(version_col), where version_col is a monotonically-increasing value (an LSN, a Kafka offset, a timestamp with microsecond precision). ClickHouse’s background merges will then reconcile duplicates within the same primary key by keeping only the row with the highest version.
There are three subtleties that trip teams up.
One: reconciliation is eventual, not immediate. Background merges run when the engine decides to run them; a freshly-written row is not deduplicated at query time unless you use the FINAL keyword. FINAL forces the deduplication at query time and is expensive on hot tables. The idiomatic pattern is argMax(col, version_col) inside a GROUP BY primary_key, which is cheaper than FINAL and gives you the same “latest row wins” semantics.
Two: deletes need a soft-delete flag. ReplacingMergeTree does not delete anything; it keeps the row with the highest version. To model a Postgres DELETE, you emit a tombstone row with an is_deleted = 1 flag and the current version, and you filter it out at query time (WHERE is_deleted = 0, applied after the argMax reconciliation). If you skip the tombstone, deleted rows stay in the warehouse forever.
Three: primary-key alignment matters. ClickHouse’s ORDER BY key is what ReplacingMergeTree uses to identify duplicates. If you get the ORDER BY wrong (say, you sort by event_time before order_id), the engine will not deduplicate the way you expect, and you will find yourself with double-counted revenue in the mart. The ORDER BY for a CDC-target table should always lead with the source primary key.
Most teams learn all three of these the hard way. The first data-quality issue is usually “why are we showing yesterday’s revenue as double.” The second is “why does the number of active users only go up.” The third is “why is FINAL so slow on the fact table.” All three are the same underlying phenomenon: ClickHouse’s storage model is not Postgres’s, and the CDC pipeline has to bridge that gap explicitly.
None of the three CDC vendors will explain this to you at the sales stage. Debezium’s docs mention it in passing. Airbyte’s ClickHouse destination documents the ReplacingMergeTree pattern but does not stress the ORDER BY alignment. ClickPipes handles it correctly by default, which is one of the reasons it exists.
Where Goni fits
We are not a CDC vendor. Goni’s ingestion side runs on Arrow Flight - our source-hub streams from source databases into ClickHouse over gRPC with columnar batching, which is a different shape from row-oriented CDC. It fits teams that want tight semantic-layer integration (the ingested rows are the semantic layer’s staging models directly) and are comfortable with batch-shaped, minute-fresh data rather than sub-second replication.
If your workload needs sub-second CDC, run Debezium. If it needs sub-minute CDC on ClickHouse Cloud, run ClickPipes. If it needs simple batch-shaped CDC alongside SaaS ELT, run Airbyte. If it needs the ingested rows to feed a semantic layer that BI, saved queries, and AI Q&A share on top of, take a look at Goni.
The one-sentence version
CDC to ClickHouse is not a “pick the tool” problem. It is a “understand the storage model, then pick the tool” problem. Every team that skips the first step ends up rewriting the second one.