You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/spicedb/concepts/zanzibar.mdx
+51-42Lines changed: 51 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,17 @@ import { Callout } from 'nextra/components'
5
5
6
6
# Google Zanzibar
7
7
8
-
Zanzibar is the internal authorization system at Google.
8
+
SpiceDB is based on Google Zanzibar, a revolutionary authorization system developed by Google to handle the massive scale and complexity of their services.
9
9
10
-
A [research paper] publicly documenting the system was published at [2019 USENIX Annual Technical Conference][usenix].
10
+
You may recognize the system if you've ever shared access with another user to a Google product like Google Docs or Gmail.
11
+
12
+
It's designed to provide consistent, secure, and reliable authorization decisions across Google's vast network of applications and users.
13
+
14
+
A [research paper] publicly documenting the system was published at [2019 USENIX Annual Technical Conference][usenix]. You can check out our [annotated version], which describes the concepts behind its design and implementation.
11
15
12
16
[research paper]: https://authzed.com/zanzibar
13
17
[usenix]: https://www.usenix.org/conference/atc19
18
+
[annotated version]: https://authzed.com/zanzibar
14
19
15
20
## History
16
21
@@ -89,12 +94,22 @@ On June 28th 2021, Zanzibar was presented to the [Papers We Love] New York City
89
94
90
95
## Differences with SpiceDB
91
96
92
-
<Callouttype="info">
93
-
The Annotated Zanzibar paper has multiple sets of annotations!
97
+
SpiceDB attempts to remain true to Zanzibar's design principles, but without any assumptions around Google's internal infrastructure and use cases.
98
+
As a result, many things in SpiceDB are more flexible to accommodate different kinds of users with different software stacks.
99
+
For example, [modeling complex user systems][model-users] is possible in SpiceDB, but in Zanzibar all users must be a uint64 identifier.
100
+
101
+
Because SpiceDB is not forced on developers as company-wide requirement, the project also values developer experience and making the tooling pleasant to work with.
102
+
You can see this in our [Schema Language] and [Playground] which vastly improves the user experience of directly manipulating Protocol Buffers at Google.
94
103
95
-
You can read it with [annotations highlighting the differences between SpiceDB and Zanzibar][paper-diff], too!
@@ -126,14 +141,21 @@ This disambiguation also allowed SpiceDB to drop the confusing `_this` keyword u
126
141
### Reverse Indices
127
142
128
143
Both Zanzibar and [SpiceDB][spicedb-expand] implement a ["Reverse Index Expand" API][expand].
129
-
This API responds with a tree structure that can be awkward for applications to consume, especially when it's ideal to avoid co-mingling permissions logic and application code.
130
144
131
-
As a result, SpiceDB supports additional APIs to simplify consuming [Reverse Indices] without structure.
132
-
In practice, we find that folks prefer a flattened list of results.
145
+
However, this API responds with a tree structure that can be awkward for applications to consume, especially when it's ideal to avoid co-mingling permissions logic and application code.
146
+
147
+
As a result, SpiceDB supports additional APIs: the [LookupResources] and [LookupSubjects] APIs, which are designed to answer the following questions, respectively:
148
+
149
+
- "What are all of the resources this subject can access?"
150
+
- "What are all of the subjects with access to this resource?"
Object IDs follow the following Regular Expression:
172
194
173
-
```
174
-
^(([a-zA-Z0-9/_|\\\-=+]{1,})|\\*)$
175
-
```
195
+
```
196
+
^(([a-zA-Z0-9/_|\\\-=+]{1,})|\\*)$
197
+
```
176
198
177
199
<ObjectIDDiagram />
178
200
@@ -187,22 +209,22 @@ This allows SpiceDB to support more complex user systems and perform more powerf
187
209
188
210
A simple example is a SpiceDB schema modeling both users and API keys:
189
211
190
-
```zed
191
-
definition ApiKey {}
192
-
definition User {
193
-
relation keys: ApiKey
194
-
}
195
-
```
212
+
```zed
213
+
definition ApiKey {}
214
+
definition User {
215
+
relation keys: ApiKey
216
+
}
217
+
```
196
218
197
219
You can now model relations and permissions with either type:
198
220
199
-
```zed {4}
200
-
definition Post {
201
-
relation viewer: User
202
-
...
203
-
permission view = viewer + viewer->keys
204
-
}
205
-
```
221
+
```zed {4}
222
+
definition Post {
223
+
relation viewer: User
224
+
...
225
+
permission view = viewer + viewer->keys
226
+
}
227
+
```
206
228
207
229
Now developers don't have to implement logic in every app that resolves API Keys because SpiceDB already knows how to resolve them.
208
230
@@ -221,14 +243,6 @@ Now developers don't have to implement logic in every app that resolves API Keys
221
243
222
244
## FAQ
223
245
224
-
### What is Google Zanzibar?
225
-
226
-
Google Zanzibar is a revolutionary authorization system developed by Google to handle the massive scale and complexity of their services.
227
-
It's designed to provide consistent, secure, and reliable authorization decisions across Google's vast network of applications and users.
228
-
Google published a paper (check out our [annotated copy](https://zanzibar.tech/)) describing the concepts behind its design and implementation.
229
-
230
-
You may recognize the system if you’ve ever shared access with another user to a Google product like Google Docs or Gmail.
231
-
232
246
### Is Zanzibar the same as ReBAC?
233
247
234
248
While Zanzibar is closely associated with ReBAC (Relationship-Based Access Control), it's not exactly the same thing.
@@ -238,11 +252,6 @@ Zanzibar uses ReBAC as its underlying authorization model.
238
252
So, you could say that Zanzibar is a ReBAC system, but it's more than that.
239
253
It also encompasses the infrastructure, algorithms, and optimizations that allow it to operate at Google's immense scale.
240
254
241
-
### How does SpiceDB relate to Google Zanzibar?
242
-
243
-
SpiceDB is an open source authorization system inspired by Google Zanzibar, designed to provide similar functionality with a focus on being accessible and adaptable to a wider range of use cases.
244
-
It shares Zanzibar's core principles,including relationship-based access control (ReBAC), scalability, performance, and strong consistency.
Copy file name to clipboardExpand all lines: pages/spicedb/getting-started/client-libraries.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,12 @@ Additionally, there are `example` directories in the client libraries that provi
19
19
## HTTP Clients
20
20
21
21
SpiceDB exposes an HTTP API when run with the `--http-enabled` flag.
22
-
While Authzed doesn't officially maintain HTTP client libraries, there are [OpenAPI] docs available [here](../api/http-api).
23
-
and served by a SpiceDB instance running the HTTP server.
24
-
For example:
22
+
While Authzed doesn't officially maintain HTTP client libraries, there are [OpenAPI] docs available [here](../api/http-api) and served by a SpiceDB instance running the HTTP server.
>Reverse-index expand answers the question "what does this employee have access to?", which most organizations validate as part of meeting those compliance obligations.
65
-
>But, even more critically, organizations use this information to debug access issues and as baseline data to ensure careful data handling.
66
-
>
67
-
> — Lea Kissner, Zanzibar Coauthor
68
-
69
-
In SpiceDB, reverse indices often refer to the [LookupResources] and [LookupSubjects] APIs which are designed to answer the following questions, respectively:
70
-
71
-
- "What are all of the resources this subject can access?"
72
-
- "What are all of the subjects with access to this resource?"
### How does SpiceDB improve on Google's Zanzibar?
78
-
79
-
At a high-level, SpiceDB attempts to remain true to Zanzibar's design principles, but without any assumptions around Google's internal infrastructure and use cases.
80
-
As a result, many things in SpiceDB are more flexible to accomodate different kinds of users with different software stacks.
81
-
For example, [modeling complex user systems][model-users] is possible in SpiceDB, but in Zanzibar all users must be a uint64 identifier.
82
-
83
-
Because SpiceDB is not forced on developers as company-wide requirement, the project also values developer experience and making the tooling pleasant to work with.
84
-
You can see this in our [Schema Language] and [Playground] which vastly improves the user experience of directly manipulating Protocol Buffers at Google.
85
-
86
-
For more specific details, see the documentation on the [Zanzibar][z-diff].
0 commit comments