Unique IDs with Causality 00:00:01 A number on a letter travels between servers Three correspondents maintain independent counters. A sends a letter to B with its current number. When B opens it, predict how to assign a number greater than both relevant histories. Three servers, all counters at 0. Something happens on A. Its counter becomes 1. max(0, 2) plus 1 equals 3. C counts 1. It knows nothing of A and B. max(1, 4) plus 1 equals 5. A1, A2, B3, B4, C5 is one chain. C1 is concurrent with the first four, and its number does not show it. Lamport time respects happened-before in one direction. A smaller scalar clock by itself cannot prove one event caused another, because unrelated events can receive comparable numbers. 00:00:56 Three counters show two independent edits Give each correspondent one component in a vector. Compare the vector after B receives A's letter with C's independent local event. Check every component before declaring an order. All vectors are zero. A counts its own place and sends the vector to B. The larger of each pair, then B's own place: [1, 1, 0]. A's [1, 0, 0] is at most [1, 1, 0] in every place: A came before B. B is larger in the first two places, C in the third. Neither knew of the other. C receives B's version and merges: [1, 1, 2]. It now follows both. Component-wise dominance can identify a causal order among these tracked events. Incomparable vectors expose concurrency, at the cost of tracking more metadata than a scalar. 00:01:56 Keep a wall-time hint without reversing a reply A's physical clock is ahead of B's. Carry both a physical-time component and a logical counter through their request and reply. Predict how B orders its answer after receiving A's later timestamp. A's clock says 1,040. The question is (1040, 0). B's clock says 1,010. The message has the largest time, so B takes 1,040 and counts one more: (1040, 1). B's clock is still behind, so only the counter grows: (1040, 2). The answer sorts after the question. Soon B's own clock passes 1,040. It leads again and the counter goes back to 0. Hybrid logical time can remain near wall time while respecting observed causal messages. A total timestamp order alone still does not prove that two separated events influenced one another. 00:02:57 A reply arrives before the letter it answers Letter four arrives carrying a dependency on letter three. The receiver has read only through letter two. Watch the handoff when the missing predecessor finally reaches the mailbox. Letter 4 arrives and says: seen 3. Letter 3 is not here. Letter 3 arrives. It needs 2, which was read. Now 4 is ready too and is shown at once. 5a and 5b both say: seen 4. Both are shown; a fixed rule decides which comes first. Buffering a dependent update can preserve causal delivery. Independent replies may be displayed in either valid order, with a separate deterministic rule if the interface needs a stable tie-break. 00:03:42 Sorting two posts by wall time tells the wrong story A reply written on a slower clock appears to predate its question. Compare plain wall-clock sorting with logical and hybrid clocks along the actual message path. The post has time 1,040 and the reply 1,010. Sorted, the reply is first. The reply is larger because it was caused by the post. Also right, and still near the real time. Select the guarantee your feature consumes. A display sequence, a unique identifier, a proof of causal dependency and an accurate wall-clock timestamp are related but distinct requirements.