A growing class of applications demands \emph{fair ordering/sequencing} of events which ensures that events generated earlier by one client are processed before later events from other clients. However, achieving such sequencing is fundamentally challenging due to the inherent limitations of clock synchronization. We advocate for an approach that embraces, rather than eliminates, clock variability. Instead of attempting to remove error from a timestamp, Tommy, our proposed system, leverages a statistical model to compare two noisy timestamps probabilistically by learning per-clock offset distributions. Our preliminary statistical model computes the probability that one event precedes another w.r.t. the wall-clock time without access to the wall-clock. This serves as a foundation for a new relation: \emph{likely-happened-before} denoted by $\xrightarrow{p}$ where $p$ represents the probability of an event to have happened before another. The $\xrightarrow{p}$ relation provides a basis for ordering multiple events which are otherwise considered \emph{concurrent} by the typical \emph{happened-before} ($\rightarrow$) relation. We highlight various related challenges including intransitivity of $\xrightarrow{p}$ relation as opposed to the transitive $\rightarrow$ relation. We also outline several research directions: online fair sequencing, stochastically fair total ordering, host-level support for fairness and more.
academic
Beyond Lamport, Towards Probabilistic Fair Ordering
This paper addresses the challenge of fair ordering in distributed systems by proposing a novel approach that embraces rather than eliminates clock variability. The authors design the Tommy system, which learns the offset distribution of each clock and employs statistical models for probabilistic comparison of noisy timestamps. The core innovation is the introduction of the "likely-happened-before" relation (p), where p represents the probability that one event occurred before another. This relation enables ordering of events that the traditional happened-before relation (→) considers concurrent, but also introduces new challenges such as non-transitivity.
Fair ordering in distributed systems requires ensuring that events generated earlier by one client are processed before events generated later by other clients. This is crucial in competitive applications such as financial exchanges and advertising exchanges, collectively termed "auction-apps."
Financial Fairness: In financial transactions, the order of message processing directly affects transaction outcomes; unfair ordering can result in substantial economic losses
Cloud Migration Requirements: Traditional financial exchanges use dedicated infrastructure to ensure fairness, but migration to public clouds necessitates new network primitives
Expanding Application Scope: Beyond financial trading, competitive markets, NFT trading, and limited-quantity product purchasing scenarios all require fair ordering
Basic limitations of clock synchronization: In asynchronous or bounded-synchronous networks, the clock synchronization precision among n processes cannot exceed u(1−1/n), where u represents the uncertainty in link delays.
Fair Ordering Definition: The order in which the server observes messages should match the order observed by an omniscient observer.
Input: Client message streams with local timestamps
Output: Message batches fairly ordered by generation time
Constraints: No access to global clocks; only best-effort clock synchronization available
TrueTime Baseline: Simulates Spanner TrueTime, assigning each message an uncertainty interval [T−3σ,T+3σ]; overlapping intervals are assigned the same rank.
Engineering solutions using equal-length cables and low-jitter switches, where processing by arrival order is equivalent to ordering by generation time.
Proposition 1: For independent normal random variables X∼N(μX,σX2), Y∼N(μY,σY2), Z∼N(μZ,σZ2), define preference relation X≻Y⇔Pr[X>Y]>21, then ≻ is transitive.
Proof Outline:
Pr[A>B]>21⇔μA>μB
Since mean values are transitive, the probabilistic relation is also transitive.
For arbitrary distributions, transitivity does not necessarily hold, and cycles like A≻B, B≻C, C≻A may occur, similar to the "rock-paper-scissors" phenomenon.
This paper pioneering introduces probabilistic fair ordering, providing a new solution direction for fairness problems in distributed systems. Although facing some theoretical and implementation challenges, its core ideas possess significant academic value and practical potential, laying the foundation for subsequent research.