---
title: "Under the Hood: Building MySQL Change Data Capture in ClickPipes"
description: "ClickPipes captures MySQL changes by streaming the ROW-format binary log after an initial consistent snapshot, tracking progress through either GTID sets or binlog file/position checkpoints."
url: "https://swe.quest/articles/under-the-hood-building-mysql-change-data-capture-in-clickpipes-285d2b2e8ad92711"
canonical: "https://clickhouse.com/blog/building-msql-change-data-capture-in-clickpipes"
source: "ClickHouse"
published: "2025-05-13"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 7
tags: ["event-driven","mysql","replication","analytics","data-pipelines"]
---

# Under the Hood: Building MySQL Change Data Capture in ClickPipes

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-05-13, 7 min read, Deep dive. Original: [https://clickhouse.com/blog/building-msql-change-data-capture-in-clickpipes](https://clickhouse.com/blog/building-msql-change-data-capture-in-clickpipes)

## Summary

ClickPipes captures MySQL changes by streaming the ROW-format binary log after an initial consistent snapshot, tracking progress through either GTID sets or binlog file/position checkpoints. The source needs binlog\_format=ROW and binlog\_row\_image=FULL so updates can be replayed idempotently. Schema changes are handled by parsing DDL with TiDB's SQL parser, and MySQL types are mapped to ClickHouse types, for example ENUM to LowCardinality(String) and VECTOR to Array(Float32). GTID mode survives failover, but position-based tracking requires resyncing the pipe. Column drops and renames, table renames and TRUNCATE are not propagated, and the target is tens of thousands of changes per second at under 30s latency.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [MySQL](https://swe.quest/tags/mysql.md) (Data & databases)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)

## Prerequisites

- MySQL replication basics ([easy posts on MySQL](https://swe.quest/tags/mysql.md?difficulty=easy))
- change data capture concepts

## Keywords

ClickPipes, ClickHouse Cloud, MySQL binlog, GTID, go-mysql, TiDB SQL parser

## Related posts

- [MySQL CDC connector for ClickPipes is now Generally Available](https://swe.quest/articles/mysql-cdc-connector-for-clickpipes-is-now-generally-available-67d5bc9ddaf5dc04.md): ClickHouse · 2026-09-02 · Easy · 6 min read · Event-driven architecture, MySQL, Analytics & OLAP, Replication, Data pipelines
  ClickPipes' MySQL CDC connector, which replicates MySQL and MariaDB into ClickHouse Cloud, is generally available after moving over 1PB for hundreds of customers.
- [Streamkap: An out-of-the-box CDC solution for ClickHouse](https://swe.quest/articles/streamkap-an-out-of-the-box-cdc-solution-for-clickhouse-fb75535a3b94ad24.md): ClickHouse · 2024-02-22 · Medium · 14 min read · Event-driven architecture, Analytics & OLAP, Data pipelines, Schema migrations
  Streamkap's ClickHouse connector streams change data capture from PostgreSQL, MySQL, SQL Server, Oracle and MongoDB into ClickHouse using Kafka, Debezium and Flink.
- [Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 1](https://swe.quest/articles/change-data-capture-cdc-with-postgresql-and-clickhouse-part-1-10e3d601e2748dab.md): ClickHouse · 2023-06-15 · Medium · 23 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Replication, Queues & messaging
  Postgres-to-ClickHouse CDC can be built by streaming row changes from Postgres logical decoding (pgoutput plugin, replication slots, LSN ordering) through Debezium and Kafka, then applying them in ClickHouse with the ReplacingMergeTree engine.
- [How Spyne simplified their CDC pipeline with ClickPipes and ClickHouse Cloud](https://swe.quest/articles/how-spyne-simplified-their-cdc-pipeline-with-clickpipes-and-clickhouse-cloud-44d67da08e6e4dbc.md): ClickHouse · 2026-06-22 · Medium · 6 min read · Event-driven architecture, Data pipelines, Analytics & OLAP, Schema migrations
  Spyne replaced a self-managed Debezium → Kafka → ClickHouse Kafka-engine/materialized-view CDC pipeline with ClickPipes on ClickHouse Cloud.
- [Postgres CDC in ClickHouse, A year in review](https://swe.quest/articles/postgres-cdc-in-clickhouse-a-year-in-review-6b9d350bcade98d4.md): ClickHouse · 2025-12-03 · Medium · 13 min read · PostgreSQL, Event-driven architecture, Data pipelines, Analytics & OLAP, Replication
  A year after PeerDB's acquisition, Postgres CDC into ClickHouse via ClickPipes has grown to 400+ companies replicating over 200 TB per month, driven by real-time customer-facing analytics and data warehousing workloads.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
