AlgoViz

Versioning data and tunable quorums

medium 24 min

When several machines accept changes to the same key, a store needs versions to tell newer from conflicting.

Where it shows up

The same pattern appears across everyday software.

  • Amazon's shopping cart on Dynamo

    The paper measured the versions returned to the cart service during 24 hours: 99.94% of requests saw exactly one version.

  • Amazon DynamoDB

    Offers conditional writes for optimistic locking. In global tables with the default mode, the latest internal timestamp wins for each item.

  • Apache Cassandra

    Every cell has a timestamp and the last write wins. The documentation asks for synchronized clocks, for example with NTP.

  • Riak KV

    Keeps siblings when a bucket allows several values, recommends dotted version vectors, and offers CRDT-style data types.

  • Git

    Two commits with a common ancestor, neither containing the other, are concurrent. Git merges them and asks a person about lines that clash.

  • HTTP ETags

    A server sends a version tag with a page. A client sends it back with If-Match, and the server refuses the change with status 412 if the page has changed since.