Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 23 min read Case study mediumAdept

Capturing Every Change From Shopify’s Sharded Monolith

Shopify is replacing Longboat, its query-based change-data capture tool that polls MySQL replicas on an updated_at column, with a log-based CDC platform built on Debezium, Kafka Connect and Kafka that reads the binlog from 100+ MySQL shards. Polling caps data freshness at about an hour and cannot capture hard deletes, intermediate row states, or updates that skip updated_at. It also produces snapshots with mismatched high-water marks. The new design merges per-shard Debezium output into one Kafka topic per logical table, so a single CDC pipeline can serve both the internal data warehouse and the merchant analytics platform with near-real-time change events.

Related posts

  • Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 2

    ClickHouse mediumAdept

    A Postgres-to-ClickHouse CDC pipeline is built with Debezium, Kafka Connect and a ClickHouse materialized view, keeping a ReplacingMergeTree table in sync with the 28M-row UK property price dataset under a mix of inserts, updates and deletes. Key configuration choices include REPLICA IDENTITY FULL (required for delete support), the pgoutput logical decoding plugin, per-row ordering via a single or hash-partitioned Kafka topic, and version/deleted columns in the ReplacingMergeTree engine. The ORDER BY is chosen for analytical access patterns, with the Postgres id appended last for uniqueness. The initial load uses the postgresql table function via INSERT INTO SELECT, which loads all 28M rows in about 80 seconds without tuning but requires pausing writes; Debezium's consistent snapshot is the alternative.

  • Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 1

    ClickHouse mediumAdept

    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. Updates and deletes become immutable inserts carrying a version column and a deleted flag, and background merges collapse duplicates. Correct results before a merge require FINAL at query time. Consumers must tolerate duplicate events after restarts, and deleted rows are only purged when clean_deleted_rows is set to Always, a setting with a known bug as of 23.5. The post also compares pull-based and push-based CDC and explains why a Kafka queue protects the Postgres WAL from growing when ClickHouse is unavailable.

  • How Spyne simplified their CDC pipeline with ClickPipes and ClickHouse Cloud

    ClickHouse mediumAdept

    Spyne replaced a self-managed Debezium → Kafka → ClickHouse Kafka-engine/materialized-view CDC pipeline with ClickPipes on ClickHouse Cloud. The move eliminated 1–1.5 hours of manual work per table onboarding and fixed schema drift, where new source columns were silently dropped by DDL-locked materialized views. It also brought tradeoffs: snapshotting a new table pauses the whole pipe, so critical tables were isolated into dedicated pipes. ReplacingMergeTree's eventual consistency required adding FINAL to queries at extra CPU cost, and binlog loss forces full table resyncs instead of targeted partial ones.

  • MySQL CDC connector for ClickPipes is now Generally Available

    ClickHouse easyNovice

    ClickPipes' MySQL CDC connector, which replicates MySQL and MariaDB into ClickHouse Cloud, is generally available after moving over 1PB for hundreds of customers. Snapshots now run in parallel by default, with the partition key detected automatically from the primary key (including string and UUID types). In benchmarks this cut a 1TB snapshot from over a day to about an hour on 32 workers. New pipes require GTID-based replication, which survives failover unlike binlog file/offset positions, and at least 72 hours of binlog retention to avoid forced full resyncs. Also new are CPU, memory, network and source/destination lag metrics, Terraform and OpenAPI management, and volume-based billing starting September 1, 2026.

  • Build a Real-time Materialized View from Postgres Changes using Confluent’s ksqlDB

    Neon mediumAdept

    Postgres logical replication can feed a Debezium-based CDC connector on Confluent Cloud that streams changes from Neon tables into Kafka topics, where ksqlDB aggregates them into a continuously updated materialized view. The walkthrough builds a player leaderboard: create a publication and pgoutput replication slot, configure the Postgres CDC Source connector with JSON_SR schemas, import topics as ksqlDB streams, and define a SUM aggregation table with EMIT CHANGES. Compared with Postgres REFRESH MATERIALIZED VIEW, this approach avoids repeated refresh costs, retains history in Kafka, and pushes updates to subscribers via the ksqlDB REST API.

The quest for software engineering knowledge.

Look:
Layout: