Zanzibar uses a simple data model and a powerful query language.
A relation is written as one line of text, called a tuple: doc:summary-pdf#owner@123. Doc is the namespace, and photo and drive are other namespaces. Summary-pdf is the object ID, owner is the relation and 123 is the user ID. The paper has three relations: owner, editor and viewer.
The query language works on sets of users.
- Set operations. Union, intersection and exclusion. Exclusion removes a set: a photo is visible to the family, except the people who are currently in China.
- Computed sets. All admins of a group, or all viewers in the engineering group.
- User sets. The user ID of a tuple can be a group, written as org:engg#member.
A new person is added to org engineering once. Every object that gives access to engineers is then accessible to that person.
Tuple to userset expands a set into user IDs: 10, 20, 30, 40. These sets can be used in a union or an intersection.