this is the tracking issue for fixing those TOUCH ...
# spicedb
j
this is the tracking issue for fixing those TOUCH semantics: https://github.com/authzed/spicedb/issues/901
f
Yes I've seen this issue, but for the time being should I be using CREATE?
j
TOUCH is idempotent, so if you're looking for idempotency then I would just use TOUCH, unless you have a demonstrated performance challenge
f
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
what datastore backend are you using?
f
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
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
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
there will be some follow-on effect for checks as well because there are fewer overall relationship versions
f
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
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
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
yes, that's correct
3 Views