---
title: "Partition Finalization in Pinterest’s Next-Generation DB Ingestion Framework"
description: "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."
url: "https://swe.quest/articles/partition-finalization-in-pinterest-s-next-generation-db-ingestion-framework-f8587191e2b11efa"
canonical: "https://medium.com/pinterest-engineering/partition-finalization-in-pinterests-next-generation-db-ingestion-framework-4c7da6e4cc8f"
source: "Pinterest Engineering"
published: "2026-09-25"
difficulty: "hard"
kind: "Case study"
reading_minutes: 11
tags: ["stream-processing","data-pipelines","event-driven","time-clocks"]
---

# Partition Finalization in Pinterest’s Next-Generation DB Ingestion Framework

A post on [Pinterest Engineering](https://swe.quest/sources/pinterest.md), published 2026-09-25, 11 min read, Case study. Original: [https://medium.com/pinterest-engineering/partition-finalization-in-pinterests-next-generation-db-ingestion-framework-4c7da6e4cc8f](https://medium.com/pinterest-engineering/partition-finalization-in-pinterests-next-generation-db-ingestion-framework-4c7da6e4cc8f)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Stream processing](https://swe.quest/tags/stream-processing.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [Time & clocks](https://swe.quest/tags/time-clocks.md) (Distributed systems)

## Prerequisites

- Apache Flink checkpoints ([easy posts on Stream processing](https://swe.quest/tags/stream-processing.md?difficulty=easy))
- Apache Iceberg snapshots
- Change data capture
- Event-time watermarks

## Keywords

Apache Flink, Apache Iceberg, Apache Kafka, Apache Spark, t-digest, CDC, Pinterest

## Related posts

- [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.
- [ClickHouse Fivetran Destination moves to Beta](https://swe.quest/articles/clickhouse-fivetran-destination-moves-to-beta-4779b917ab081e2d.md): ClickHouse · 2026-02-25 · Medium · 11 min read · Analytics & OLAP, Data pipelines, SQL, Performance engineering
  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.
- [What Replo learned optimizing 100+ billion events in ClickHouse](https://swe.quest/articles/what-replo-learned-optimizing-100-billion-events-in-clickhouse-4b7228146ec28a74.md): ClickHouse · 2026-03-09 · Medium · 7 min read · Analytics & OLAP, Databases, Performance engineering, Scaling
  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.
- [Announcing the Fivetran Destination for ClickHouse Cloud](https://swe.quest/articles/announcing-the-fivetran-destination-for-clickhouse-cloud-fb04100010478236.md): ClickHouse · 2024-04-25 · Easy · 4 min read · Analytics & OLAP, Data pipelines, Consistency models
  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.
- [Consuming the Delta Lake Change Data Feed for CDC](https://swe.quest/articles/consuming-the-delta-lake-change-data-feed-for-cdc-a3df7811b1c94f79.md): ClickHouse · 2025-08-19 · Medium · 16 min read · Event-driven architecture, Data pipelines, Analytics & OLAP, Storage engines
  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.

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)
