Pinterest's Petabyte-Scale Data: Event Time for Finalization
Alps Wang
Oct 19, 2026 · 2 views
Bridging Streaming and Batch Guarantees
Pinterest's adoption of event time watermarks for finalizing petabyte-scale data partitions is a sophisticated solution to a perennial challenge in streaming data ingestion: ensuring downstream consumers receive data with both freshness and completeness guarantees. The core innovation lies in leveraging Apache Flink's event time tracking and Apache Iceberg's metadata capabilities to create a non-regressing, monotonically increasing watermark. This watermark acts as a reliable signal for partition finalization, effectively bridging the gap between the continuous, unbounded nature of streaming Change Data Capture (CDC) and the deterministic completion points expected by batch processing. The use of t-digests for event time distribution statistics within Iceberg snapshot summaries is particularly elegant, offering a compact yet informative representation of data timeliness. This approach moves beyond simple wall-clock partitioning, which is inherently flawed in the face of late-arriving data, and provides a robust mechanism for data producers and consumers to agree on data readiness.
The implications for data engineering are substantial. By providing a standardized, metadata-driven approach to partition finalization, Pinterest's framework reduces the need for complex, custom coordination services. Downstream jobs, whether Spark or other processing engines, can directly query Iceberg table properties for the finalization watermark, simplifying pipeline orchestration and reducing operational overhead. The ability to configure policies that balance data freshness against completeness (e.g., using percentiles) offers flexibility for different analytical needs. This is a crucial advancement for organizations dealing with massive, continuously updating datasets where the cost of stale or incomplete data can be significant. The integration within the Flink-to-Iceberg sink, utilizing extensibility points like accumulators and commit processors, demonstrates a practical and well-engineered solution built upon existing, powerful open-source technologies.
Key Points
- Pinterest implemented an event time-based partition finalization mechanism for its next-generation database ingestion framework.
- The approach uses Apache Flink to measure event time progress and Apache Iceberg metadata to publish a non-regressing finalization watermark.
- This addresses the challenge in continuous Change Data Capture (CDC) ingestion where data can arrive after a partition’s wall clock interval has ended.
- The system extracts event time from CDC records, collects event time statistics during Flink checkpoints, and stores them in Iceberg snapshot summaries using t-digests.
- A partition finalization watermark is calculated from recent checkpoint statistics and stored as an Iceberg table property, allowing downstream sensors to read it.
- The watermark is monotonic, preventing late-arriving records from affecting already published values backward.
- This design allows for streaming ingestion to provide freshness guarantees similar to batch processing without losing data completeness.

📖 Source: Pinterest Uses Event Time Watermarks to Finalize Petabyte Scale Data Partitions
Related Articles
Comments (0)
No comments yet. Be the first to comment!
