https://authzed.com logo
#spicedb
Title
# spicedb
j

Jake

02/06/2023, 2:21 PM
this is the tracking issue for fixing those TOUCH semantics: https://github.com/authzed/spicedb/issues/901
f

Francisco Correia

02/06/2023, 2:21 PM
Yes I've seen this issue, but for the time being should I be using CREATE?
j

Jake

02/06/2023, 2:22 PM
TOUCH is idempotent, so if you're looking for idempotency then I would just use TOUCH, unless you have a demonstrated performance challenge
f

Francisco Correia

02/06/2023, 2:23 PM
We do have a lot of performance metrics that we're trying to hit so I think in that case CREATE makes more sense right?
j

Jake

02/06/2023, 2:23 PM
what datastore backend are you using?
f

Francisco Correia

02/06/2023, 2:23 PM
Also, is there more information about the GC?
We're currently testing both Postgres and Cockroach
But mostly we've been using Postgres, we want to see if it's good enough in terms of performance and how it scales with data
j

Jake

02/06/2023, 2:24 PM
for cockroach, I don't think we need to do anything to "fix" idempotency performance
for postgres, early indications are that touch is more performant than create after the improvement
f

Francisco Correia

02/06/2023, 2:25 PM
Yeah this question is mostly about Postgres
Touch is more performant for writes? But what about for check queries?
I guess my main concern is about how the check query scales with data
j

Jake

02/06/2023, 2:27 PM
there will be some follow-on effect for checks as well because there are fewer overall relationship versions
f

Francisco Correia

02/06/2023, 2:29 PM
Are there any documented tests for that which I can read? I'm more worried about the check query performance than the write tbh which is why I think it might make more sense to only use the CREATE not the TOUCH but it depends on the correlation between check latency and data in the DB
j

Jake

02/06/2023, 2:30 PM
if you can use
CREATE
, by all means go for it! some use cases are really challenging to know ahead of time whether the relationship you're trying to create already exists, and if you're using
CREATE
that would return an error if the relationship exists.
f

Francisco Correia

02/06/2023, 2:31 PM
Got it, thanks for the info!!
One last question, will the GC eventually clean up data after duplicate TOUCH operations so that the DB looks the same as it would if CREATE had been used?
j

Jake

02/06/2023, 3:27 PM
yes, that's correct
3 Views