A zookie makes a read fresh enough

video locked
Enroll to watch

4 mins

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

A zookie is the timestamp a caller passes to Zanzibar with a read.

Causal ordering means one action follows another. Gaurav adds Praveen to a document, and Praveen's access has to come after the add. In the opposite order Praveen gets a failure.

Google Spanner orders actions in one line, using globally synchronized clocks. A caller asks it for the next number. Gaurav gets 30, Anubhav gets 31 and Adeeb gets 32. These are globally ordered timestamps.

A read carries its timestamp to Zanzibar. Zanzibar holds user 10 for the users in Google, and its latest update is at 31:

  1. Gaurav sends 30. The data was updated at 31, so the data is good and Zanzibar returns 10.
  2. Anubhav sends 31. The two timestamps match, and Zanzibar returns the response it has.
  3. Adeeb sends 32. Zanzibar has older data than Adeeb is asking for, so the data may be stale for him. Zanzibar fetches the latest value for the key from its database.