So…who gets the cake, and what do we eat? Two stories of time, order, and consensus

Your mom in this moment
  1. Given events A and B which occur in a single process, we can say A comes before B if it occurred prior to B
  2. Given a message sent from one process to another, we can say the sending of the message A comes before the receiving of the message B
  3. The comes before relation of events is transitive, so if A comes before B, and B comes before C, then A comes before C
  1. The completion of a piece of homework
  2. Leaving a room
  3. Arriving in a new room
think more about cake, less about the details
  1. We know that you finished either your math homework or reading homework first, and thus the one finished first comes before the one finished second
  2. Likewise, we know the same comes before ordering above for your brothers completion of the two pieces of homework
  3. We know that each of you finished both pieces of homework prior to leaving your respective rooms, so each piece of homework finished for your comes before you leaving your room, and the same for your brother
  4. Your brother arriving at the dinner table comes before your arrival at the dinner table
  1. We do not know whether either of your pieces of homework being completed comes before your brother, or the other way around. In fact, we have no way to order these 4 events.
  2. Although we know that your brother reached the dinner table before you, this does not indicate anything about events prior, and thus we cannot say with certainty that your brother leaving his room comes before you leaving your room.
What do you mean, what am I having for dinner?
  1. Agreement: All individuals decide on the same value
  2. Validity: The decision agreed upon was suggested by one of the individuals
  3. Termination: All individuals involved eventually come to a decision
Tougher than it looks
  1. If the prior event is within the same process, the timestamp of the event is +1 of the prior event’s timestamp
  2. If the prior event is the sending of a message from another process (for which this event is the receiving of the message), the timestamp of the event is the +1 of MAX(previous event in the same process, sending of message from the other process)
  1. For events A and B in the same process, A comes before B if the timestamp of A is less than that of B
  2. For events A and B, where A is the sending of a message, and B is the receiving of a message, A comes before B
  3. Logical clock order is transitive, A comes before B implies A comes before C if B comes before C
  1. Given events A and B in separate processes, where the logical timestamp of A = B, we can say A comes before B if the priority of A’s process is greater than the priority of B’s process
What would a medium article in 2021 be without mentioning blockchain?



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aashray Anand

Aashray Anand

Working on storage management and infrastructure at Azure SQL