A zookie is the minimum freshness of data that a caller accepts.
It is not the timestamp of the query. Pooja holds a zookie of 50. Data at least as fresh as 50 is okay for her, and data before 50 is not. Tuhin holds a hundred.
A zookie is not the time of the request, so the writes at 50 and a hundred cannot be ordered and executed one by one.
Zanzibar keeps on every entry the time it was last updated. A table of four keys shows it:
- Anubhav comes with 10. Three entries are okay and one is too old.
- Pooja is okay with two entries.
- Tuhin is okay with one entry.
Entries updated on or after the zookie are served. The stale entries are fetched from the database.
In a cache, data updated three hours ago is good for a caller that accepts four hours and too old for one that wants two.
A fifth row at timestamp 3 is not fetched, because the query touches only the first four rows.