A topic in the Open Knowledge Graph — a free, open map of 15,495 topics and the order to learn them in.

At-Least-Once Delivery Semantics

Graduate Depth 104 in the knowledge graph ☐ I know this ☆ Set as goal
1topic build on this
551prerequisites beneath it
See this on the map →
Introduction to Distributed SystemsRemote Procedure Calls (RPC)→→Exactly-Once Delivery Semantics
semantics delivery correctness

Core Idea

At-least-once semantics guarantee delivery one or more times through retries until acknowledgment. This prevents message loss but allows duplication. It sits between at-most-once and exactly-once. Applications must either be idempotent or handle duplicates explicitly. It is simpler than exactly-once but stronger than at-most-once.

Explainer

From your overview of distributed systems, you know that networks are unreliable — messages can be lost, delayed, or arrive out of order. When a sender transmits a message, it faces a fundamental question: did the receiver get it? If the sender waits for an acknowledgment and none arrives, there are two possibilities: the message was lost, or the acknowledgment was lost. The sender cannot distinguish between these cases. At-least-once semantics resolve this ambiguity by choosing the safe side: if in doubt, retransmit.

The mechanism is straightforward. The sender transmits a message and starts a timer. If an acknowledgment arrives before the timer expires, delivery is confirmed and the sender moves on. If the timer expires without an acknowledgment, the sender retransmits the same message. This retry continues until an acknowledgment is finally received. The guarantee is that the message will eventually be delivered — it will not silently disappear. But the cost is obvious: if the original message *was* received and only the acknowledgment was lost, the receiver now gets the same message twice.

This is where idempotency becomes critical. An operation is idempotent if performing it multiple times produces the same result as performing it once. Setting a value (`balance = 500`) is idempotent — doing it twice leaves the balance at 500. Incrementing a value (`balance += 100`) is not — doing it twice adds 200 instead of 100. If your application's message handlers are idempotent, duplicate delivery is harmless. If they are not, you need explicit deduplication — typically by assigning each message a unique ID and having the receiver track which IDs it has already processed.

At-least-once delivery is the pragmatic sweet spot for many real-world systems. At-most-once (send and forget, never retry) risks silent data loss. Exactly-once requires complex coordination — typically combining at-least-once delivery with idempotent processing or transactional deduplication on the receiver side. Most message queues (RabbitMQ, SQS, Kafka with default settings) provide at-least-once guarantees out of the box. The design question then shifts from the transport layer to the application layer: can you make your handlers idempotent, or do you need to build deduplication logic? This framing — reliable transport plus application-level safety — is the foundation for understanding how stronger delivery guarantees are built.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Regular Language Recognition Algorithms → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Context-Free Grammar Properties and Ambiguity → Parse Trees, Derivations, and Ambiguity in CFGs → Context-Free Grammars in Compiler Design → Abstract Syntax Trees (ASTs) → Symbol Tables and Scope Resolution → Semantic Analysis Phase → Scope and Binding Resolution → Scope, Shadowing, and Variable Lifetime → Parameter Passing: Value vs. Reference → Remote Procedure Calls (RPC) → At-Least-Once Delivery Semantics

Longest path: 105 steps · 551 total prerequisite topics

Prerequisites (2)

Leads To (1)