Exactly-Once as a Contract

Concepts covered: paStreamProcessing

Delivery semantics come in three grades, and naming them precisely keeps every later argument short. At-most-once: an event affects the output zero or one times, so failures lose data. At-least-once: one or more times, so failures duplicate data. Exactly-once: the output ends up as if each event were processed precisely once, no losses, no doubles. Note the careful phrasing on the last one: it is a claim about the observable result, not about the machinery never retrying. Retries happen constantly in exactly-once systems; their effects just never land twice. The claim that matters is that exactly-once is not a switch anywhere in Spark. It is a contract with three signatures, and Structured Streaming can only sign one of them. The source must be replayable: asked for an offset range a secon

About This Interactive Section

This section is part of the Structured Streaming: Intermediate lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.

How DataDriven Lessons Work

DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.