I am trying to optimize for using ZedTokens, but I...
# spicedb
v
I am trying to optimize for using ZedTokens, but I am having a hard time understanding how they are meant to be stored in SQL. Imagine there are 3 entities:
User
,
Team
and
Project
. A
User
can be assigned to a
Team
, and a
Team
can be assigned to a
Project
. Let's say we create a
User
called
Bob
and assign him to the
Team
of
Engineers
. I get back a token after writing the relationship. Where do I store that in SQL? Alongside
Bob
or
Engineers
? Now imagine we assign 10 other users to
Engineers
(same as
Bob
). And then assign
Engineers
to the
Project
of
Dollhouse
. Now, do I have to store the token alongside every single
User
who is assigned to the
Engineers
Team
? Same as when we delete
Dollhouse
or un-assign
Engineers
from it. This also gets a lot more complex if the
Team
can be recursive (call it
Folders
if you will)
4 Views