liveBook · Manning

Exactly-once delivery

As explained in Architecting an Apache Iceberg Lakehouse

Exactly-once semantics guarantee that each input record contributes its intended processing effect no more than once despite retries or failures.

Exactly-once delivery prevents retries or failures from producing duplicate processing effects, but only when the source is replayable and the processing path coordinates state, offsets, and commits. Apache Flink uses checkpointing and two-phase commit protocols with Iceberg’s atomic snapshot commits so a checkpoint’s changes become visible together or not at all. Non-replayable sources cannot provide the same guarantee, and the ingestion tool must still prevent conflicting changes or duplicates. section 6.1.2 section 6.4.2

Apply the guarantee with explicit operational tradeoffs:

  • Track committed records with checkpoints so failures resume from a known state and retry only incomplete work. section 6.1.2 section 6.2.3
  • Balance commit frequency against freshness and metadata overhead; streaming writers commonly commit buffered records in batches. section 6.2.3
  • Treat late events, malformed records, and long-running state recovery as pipeline-design concerns rather than storage guarantees. section 6.2.3

Flink streaming into Iceberg

Define a Kafka source with a watermark, configure an Iceberg sink, and insert the source stream into the sink. With checkpointing correctly configured, Flink coordinates incremental commits with Iceberg snapshots for exactly-once delivery. section 6.4.2

Figure 6.3 By using checkpointing to track which incoming records have been committed successfully, the system knows which records to retry when a failure occurs.

Use the checkpoint flow diagram to trace which records are already committed and which records must be retried after failure. section 6.1.2

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Explains replayability, checkpointing, two-phase commits, atomic snapshots, state recovery, and commit-frequency tradeoffs without low-level protocol detail.
Examples
Demonstrates Kafka-to-Iceberg Flink SQL, checkpoint-based retries, and Spark Structured Streaming with Iceberg checkpoints.
What it assumes
Assumes familiarity with ingestion pipelines and failures, while establishing delivery guarantees, replayability, checkpoints, and transactional commits.
What you can do after
Build it from scratch with Flink or Spark, configuring replayable sources, checkpoints, transactional sinks, and recovery-aware streaming commits.
How it connects
Connects replayable sources, checkpointing, two-phase commit, Apache Flink, Apache Iceberg, streaming ingestion, and Apache Kafka.

Also explained in

Compare how 6 books explain exactly-once delivery →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.