Unique IDs with Causality
In this lesson1 sections
Unique IDs with Causality
Causality
In the previous lesson, we generated unique IDs. Beyond uniqueness, systems often need to reason about event ordering and causality. Consider two users on a social media platform. One user posts a comment (Event A), and another user replies (Event B). Event B depends on Event A and must occur after it. These two events are causally related.
Two events are concurrent in the causal sense when neither can have influenced the other through the modeled process and message history. Peter and John commenting on unrelated Tweets can be an example; the events do not have to occur at precisely the same physical instant.
Design distinction: An ID can identify an event while separate metadata records its dependencies. Combining identity and ordering in one value can be useful, but the format must actually support the ordering guarantee the application needs.
The following slides visualize concurrent and non-concurrent events.
The rest of this lesson is for Premium members
Premium opens every lesson in this course, along with all questions and solutions on PracHub.