ExercisesDistributed Systems Consensus › Distributed Clocks and Ordering

Distributed Clocks and Ordering

5 questions · Distributed Systems Consensus

1. Each server independently assigns a timestamp to events using its local clock. Server A's clock is slightly ahead. An event on Server B at time T1 and an event on Server A at T1+1ms may actually have occurred in the opposite order. What problem does this illustrate?
2. A counter that increments with each event on a node, and when a message is received, updates to max(local, received) + 1. This allows ordering events that have a causal relationship. What is this called?
3. To determine if event A on Server 1 happened before event B on Server 2 (not just the Lamport order), you need to track causality per-node. What data structure is used?
4. A database needs to assign globally monotonically increasing timestamps with wall-clock accuracy for distributed transactions, supporting both logical ordering and real-time ordering. What type of clock does Spanner use?
5. When designing a distributed system, an architect says: 'We cannot rely on timestamps to determine event order — instead we use explicit causal metadata in every message.' Which approach are they describing?

Exercise complete!

out of 5 questions