Partition Finalization in Pinterest’s Next-Generation DB Ingestion Framework
Pinterest's streaming CDC ingestion (Kafka, Flink, Iceberg, Spark) lost the implicit "partition complete" signal that batch loads provided, so it now derives a partition finalization watermark from event time. Each Flink checkpoint records min/max event time and a mergeable t-digest percentile sketch (a few hundred bytes) in the Iceberg snapshot summary. A post-commit hook then computes a monotonic, non-regressing watermark, by default the minimum of per-commit minimums over the last X commits rounded down to the hour, and stores it as a table property that downstream sensors can wait on. The Spark upsert job copies the watermark to the base table. The work is built on generic Accumulator and CommitProcessor extension points in an extensible Flink-Iceberg sink, and tables can choose percentile-based policies to trade completeness for freshness.
Related posts
- 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.
- ClickHouse Fivetran Destination moves to Beta
ClickHouse mediumAdept
The Fivetran destination for ClickHouse Cloud is now in beta and adds History Mode, which implements SCD Type 2 by inserting a new row per change with _fivetran_active, _fivetran_start and _fivetran_end columns, enabling point-in-time snapshots, change tracking and audit queries. It also supports compute-compute separation (Warehouses), so Fivetran ingestion can be isolated from analytical workloads. Because the connector orders tables by source primary keys or a generated _fivetran_id, filters on business columns can cause full scans. The recommended fixes are skip indexes, projections (including lightweight _part_offset secondary-index projections) or materialized views feeding a medallion architecture, each with storage and maintenance tradeoffs.
- What Replo learned optimizing 100+ billion events in ClickHouse
ClickHouse mediumAdept
Replo's in-product analytics for Shopify merchants ingests 3,000-5,000 events per second into ClickHouse and analyzes 100+ billion events, but reaching that point took several data-model resets. A precomputation pipeline that marked sessions with SummingMergeTree and recomputed them via a refreshable materialized view worked until fractional attribution exposed that MergeTree deduplication is only eventual. Adding FINAL/DISTINCT fixed correctness but made recomputation slower than the one-minute refresh window, causing a runaway backlog. The fix was to recompute only from a small table holding the last 40 minutes of purchase-related events, using joins in a single materialized view, and to handle historical backfills with offline scripts. Follow-up tuning included LowCardinality columns, materialized JSON fields and dropping Nullable types.
- Announcing the Fivetran Destination for ClickHouse Cloud
ClickHouse easyNovice
ClickHouse Cloud now has an open-source (Apache 2.0) Fivetran destination in public preview, written in Go on the Fivetran Partner SDK, that loads data from Fivetran's 500+ sources. Because Fivetran may send partial update events, the destination reads the full row before reinserting an updated copy, and it uses select_sequential_consistency=1 to avoid stale reads behind load balancers. That setting is cheap on SharedMergeTree but costly on ReplicatedMergeTree, so the destination is Cloud-only for now. Updates and deletes go through SharedReplacingMergeTree, which means queries need FINAL for accurate results. It suits moderate volumes of SaaS data such as Zendesk or Salesforce; for TB/PB-scale loads, ClickPipes or Kafka Connect are the recommended tools.
- Consuming the Delta Lake Change Data Feed for CDC
ClickHouse mediumAdept
Delta Lake's Change Data Feed (CDF) can drive CDC into ClickHouse by reading row-level change events reconstructed from the _delta_log transaction log and the _change_data Parquet files. Appends appear as add actions with min/max stats used for data skipping. Updates produce update_preimage/update_postimage rows and deletes produce single delete rows. On the ClickHouse side, rows land in a ReplacingMergeTree keyed on _commit_version so background merges resolve the latest state eventually, with FINAL queries for immediate correctness and soft-delete caveats. ClickHouse also releases an MIT-licensed Python reference implementation built on delta-rs and DataFusion that polls version ranges and categorizes CDC/add/remove actions.