spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

request: language support for inverse relations

Open vroldanbet opened this issue 4 years ago • 3 comments

The ask

SpiceDB language could have native support to denote the inverse of a relationship

Example:

definition repository {
  relation owner: User
}

definition user {
  inverse relation repositories: repository#owner
}

The goal

  • At very large scale, writing 2 tuples instead of one would incur additional COGS for the underlying database system
  • It removes the burden from the client-side to maintain those two relationships. With large and complex schemas, it could be difficult to keep track of all the relationships that need to be written when a new entity is persisted in the application side. As complexity increases, there could be higher chances to have inconsistent data persisted in SpiceDB

vroldanbet avatar Dec 28 '21 15:12 vroldanbet

Adding a +1 on this issue. We found ourselves needing to add inverse relationships for most of our use-cases.

jhalleeupgrade avatar Mar 06 '23 13:03 jhalleeupgrade