Why logical clocks fail at thousands of servers

video locked
Enroll to watch

7 mins

Chapters
About
Discussion0
Notes
Be the first to start a conversation!

A logical clock is a set of counters, one for each system, that orders related operations without reading the time.

Google ensures causal consistency with globally ordered timestamps from Spanner. Local clocks cannot do it. One computer runs slower, another faster, and they fall out of sync.

With three systems a logical clock works:

  1. System 1 has the first operation. It increments its counter and shares the clock with S2 and S3, which hold 1 0 0.
  2. S2 has an operation, and its clock becomes 1 1 0.
  3. S3 has an operation concurrently, and its clock becomes 1 0 1.

The first operation is proven to happen before the other two, and those two are concurrent.

With thousands of servers the array is huge, and every server maintains all of it. Many servers make operations at once, and all of them are concurrent. Only the next state is ordered after them. Most operations stay jumbled, so related operations are not ordered.

Logical clocks are accurate with a small number of servers, as in database systems.