liveBook · Manning

Message-delivery semantics

As explained in Think Distributed Systems

The rules describing whether, how often, and in what order messages reach their recipients.

Message-delivery semantics describe whether messages reach a recipient, how many times they arrive, and whether they arrive in order. They make failures and guarantees explicit in distributed systems. section 1.6

A request-response exchange separates message delivery from message processing. Delivery transfers and presents a message; processing generates a response and may create a side effect. At-most-once, at-least-once, and exactly-once describe both delivery and processing, although practical reasoning focuses especially on processing and side effects. section 4.1

The core delivery guarantees are:

  • At-most-once: the network delivers a message zero or one time. section 4.1
  • At-least-once: the network delivers a message one or more times, so duplicates remain possible. section 4.1
  • Exactly-once: the network delivers a message once; corresponding processing semantics specify whether the receiver processes it once. section 4.1
  • Messages may also be lost, duplicated, or reordered, requiring countermeasures that account for uncertainty and side effects. section 1.6

An unanswered request

If an employee sends a request but receives no response, the request or the response may have been lost. Sending the request again may cause the receiver to process it twice, creating inconsistent side effects. section 1.6

Figure 4.2 Step-by-step progression of the request-response dialogue
A diagram of a flowchart

AI-generated content may be incorrect.

Trace the request-response sequence from sender submission through network delivery, receiver processing, response submission, and response delivery. section 4.1

How Think Distributed Systems covers it

How deep it goes
Defines delivery and processing separately, classifies three guarantees, and stops short of detailed countermeasure mechanisms.
Examples
Uses a mailroom analogy, an unanswered request, and a stepwise request-response dialogue to expose loss and duplication.
What it assumes
Assumes only sender, receiver, and network roles while defining delivery, processing, and their guarantees from first principles.
What you can do after
Evaluate/understand how loss, duplication, reordering, and retries affect receiver processing and side effects.
How it connects
Connects distributed systems, crash semantics, request-response communication, message processing, network behavior, and side effects.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Think Distributed Systems. The section links point to the parts of the book it draws on.