Briefing · Article · source · published · Boston Identity
Zanzibar guards against stale permissions with Spanner and a stored token; in one 2018 week only Safe checks averaged p95 under 10 ms
Ruoming Pang and thirteen co-authors describe Zanzibar, which holds more than 2 trillion relation tuples for Google services such as Drive and YouTube and serves more than 10 million queries a second. Spanner timestamps keep permission changes in order. A zookie, which clients store with each content version and send back, keeps checks off permissions older than that content. The abstract promises a p95 under 10 ms; in the paper's one-week table, Recent checks had a mean p95 of 60 ms.
Google Research (USENIX ATC 2019) · Ruoming Pang, Ramón Cáceres, Mike Burrows, 11 co-authors · July 10, 2019 · read
What's happening
Finding4Zanzibar handles a removed user seeing new content by ordering permission writes with Spanner's TrueTime and having client services store a zookie with content.
Zanzibar handles what Google calls the "new enemy" problem, where a user removed from a permission list still sees new material, with two mechanisms. Against ignoring the order of permission changes, it relies on external consistency: Spanner's TrueTime gives each permission write a timestamp that reflects causal order, and each check is evaluated at a single snapshot. Against checking new content with an old permission list, it uses the zookie. When content is about to be saved, the client service runs a content-change check, which carries no zookie and is evaluated at the latest snapshot, and Zanzibar returns a zookie holding a timestamp later than every earlier permission write. The service stores it with that content version and sends it back on later checks, and Zanzibar may then answer from any snapshot at least that fresh. Always checking at the latest snapshot would need global synchronization, so the design lets most checks run on data already replicated, and it relies on the client services to cooperate.
flag a problem with BI-FIND-2019-0001
Figure steps
- As a user saves new content, the client service runs a content-change check. It carries no zookie, so Zanzibar evaluates it at the latest snapshot.
- If the check passes, Zanzibar returns a zookie holding a timestamp later than every earlier permission write.
- The service stores the zookie with the new content version in one atomic write.
- On a later check of that version, the service sends the stored zookie back, and Zanzibar answers from a snapshot no older than the content. A user removed before the save stays removed.
The zookie travels with the content: the service stores it beside each new version and sends it back on later checks, so Zanzibar never answers from a snapshot older than the content.
Drawn from the protocol in section 2.2 of the paperSource dated July 10, 2019Passage: Section 2
Swipe for the full figure →
Zanzibar stores permissions as relation tuples whose user can be a set, and the paper describes no condition or expiry on a grant.
Zanzibar stores permissions as relation tuples, object#relation@user, where the user can itself be a set, such as the members of group:eng. Groups, in the authors' words, "are simply ACLs with membership semantics." Rewrite rules in each namespace then add derived access: in the paper's document example an owner is also an editor, an editor is also a viewer, and viewers of a parent folder can view the documents in it. Google says Cloud IAM is built as a layer on top, and a number of clients have implemented role-based access control in the configuration language. The subject of a check is "a putative user, often represented by an authentication token," and the paper describes no condition or expiry on a grant. Taos-style compound principals, where a request arrives as "W for U", appear only in the related-work section, and the paper never says Zanzibar models them.
flag a problem with BI-FIND-2019-0002
In one December 2018 week of the paper's own data, only Safe checks met the abstract's p95 under 10 ms, at a mean 9.46 ms against 60.0 ms for Recent checks.
Google reports more than 1,500 namespaces, more than 2 trillion relation tuples in close to 100 terabytes, more than 10 million client queries a second and more than 10,000 servers. Its abstract reports 95th-percentile latency under 10 milliseconds over 3 years of production use. When we set that against the paper's own Table 2, from one week in December 2018, only the Safe requests come in under it. Those are requests whose zookie is more than 10 seconds old, which Google says are about two orders of magnitude more frequent. Check Safe had a mean p95 of 9.46 ms and, in figure 4, peaked at roughly 11 ms. Check Recent, with zookies under 10 seconds old that often need round trips between regions, had a mean p95 of 60.0 ms, and the paper gives no figure for all checks combined. The availability above 99.999% counts only "qualified" requests and comes from Google's own probers replaying a sample of live requests, because, the authors write, "we cannot measure availability directly with live traffic."
flag a problem with BI-FIND-2019-0003
Google calls hot spots on common permission lists the most critical frontier for Zanzibar, and counters them with caches spread across servers and a lock table.
Google calls hot spots "the most critical frontier" in keeping Zanzibar fast and available. To stay consistent, Zanzibar keeps its data normalized, so hot spots on common permission lists, such as popular groups, may overload the database servers underneath. Against them it uses caches spread across each cluster's servers with the snapshot timestamp in the cache key, evaluation timestamps rounded up to a coarse grain so more requests share cached results, and a lock table under which only one of the requests sharing a cache key runs while the rest wait. Per-client CPU limits keep one client's load from hurting the others, and hedged calls to Spanner and Leopard cut tail latency. Leopard is the exception to the normalized rule: an index for groups that are deeply nested or have many child groups, where a single tuple change may yield tens of thousands of index events.
flag a problem with BI-FIND-2019-0004
Section by section
5showing 5 of 5
[1]Data model, configuration language and API
Ruoming Pang, Google · Ramón Cáceres, Google
Data model, configuration language and API
Ruoming Pang, Google · Ramón Cáceres, Google
Pang et al. present Zanzibar as Google's one store and evaluator of access control lists for Calendar, Cloud, Drive, Maps, Photos and YouTube. An ACL is a relation tuple, object#relation@user, where the user may itself be a userset such as group:eng#member. Per-namespace rewrite rules (union, intersection, exclusion, computed_userset, tuple_to_userset) express inheritance. The API has Read, Write, Watch, Check and Expand.
technical artifactfrom published text + figures
[2]The new enemy problem and the zookie protocol
Ruoming Pang, Google · Ramón Cáceres, Google
The new enemy problem and the zookie protocol
Ruoming Pang, Google · Ramón Cáceres, Google
Pang et al. define the 'new enemy' problem: ignoring the order of ACL updates, or applying an old ACL to new content, lets a removed user see new material. Their answer is external consistency from Spanner's TrueTime timestamps plus the zookie, an opaque token stored with each content version and sent back on checks so the snapshot is at least as fresh. The authors say Zanzibar may pick any fresher snapshot, which lets most checks run on replicated data.
technical artifactfrom published text
[3]Architecture: aclservers, Spanner storage, Leopard index and hot-spot control
Ruoming Pang, Google · Ramón Cáceres, Google
Architecture: aclservers, Spanner storage, Leopard index and hot-spot control
Ruoming Pang, Google · Ramón Cáceres, Google
Section 3 describes aclservers that fan out Check, Read, Expand and Write inside a cluster, with tuples, namespace configs and a changelog in Spanner. Watchservers serve the Watch API. Leopard, a denormalized set index, handles deeply nested groups. The authors call hot spots 'the most critical frontier' and answer with distributed caches, timestamp quantization, a lock table, per-client cpu-second quotas and hedging of Spanner and Leopard calls, but not between aclservers.
technical artifactfrom published text + figures
[4]Production numbers, latency, availability and lessons
Ruoming Pang, Google · Ramón Cáceres, Google
Production numbers, latency, availability and lessons
Ruoming Pang, Google · Ramón Cáceres, Google
Google reports its own production figures: over 1,500 namespaces, over 2 trillion tuples near 100 TB in 30+ locations, and over 10M queries per second on 10,000+ servers. For a December 2018 week, Check Safe latency at p50, p95 and p99 is 3.0, 9.46 and 15.0 ms, and Check Recent 2.86, 60.0 and 76.3 ms. Availability above 99.999% over three years comes from probers replaying sampled live requests. The lessons drawn are about flexibility, request hedging, hot spots and isolating clients.
customer prooffrom published text + figures