AlgoViz

Unique IDs with causality

hard 30 min

Number events so that a cause always comes before its effect, even when clocks disagree.

Where it shows up

The same pattern appears across everyday software.

  • CockroachDB

    Documents hybrid logical clocks with a physical and a logical part. A node whose clock is too far from most of the others stops itself; the default maximum offset is 500 ms.

  • YugabyteDB

    Documents hybrid logical clocks for ordering transactions across nodes.

  • Riak

    Its documentation describes vector clocks and dotted version vectors as causal context for each object, used to find conflicting writes.

  • TiDB

    Uses a central timestamp oracle instead of logical clocks on each node. Its timestamps hold a physical time and a logical number.

  • DynamoDB global tables

    Resolve concurrent updates with last writer wins. They do not keep vector clocks; those belong to the Dynamo paper of 2007, which describes a different system.

  • Shared documents

    Two people edit offline. With vectors the app knows that the edits were concurrent and can merge or ask, instead of losing one.