k.zgara
10/02/2024, 10:05 AMat_least_as_freash
provides the same consistency as full consistency option if I'm sure that zed token is the most updated. So, let's say I want to have strong consistency on delete endpoint and there is no tolerance for staleness, can I use zed token there or I must use full consistency option in any way?
4. Is it really a more performant way of using zed token, since I have to retrieve zed token first from my database? This is actually quite interesting to me, cuz it seems like bottleneck are moving from SpiceDB to application. Where I can check (or briefly explained) why making request to database is more performant rather using full consistency?
Thanks!yetitwo
10/02/2024, 2:38 PMat_least_as_fresh
provides the same consistency as full consistency option if I'm sure that zed token is the most updated
yes, but that isn't the way i'd think about using at_least_as_fresh
. it's meant as a way to provide a balance between performance and consistency for reads. i'd personally recommend using fully_consistent
for deletes because it's a simpler model - you don't care whether the stored zedtoken is the most recent because you're saying "i want the most recent view of the system."
1. because you're already going to need to go to your DB to get your record. it won't meaningfully add to the request latency if you're just reversing the order of spicedb + db calls. it may require rethinking the flow of your request, especially if you were planning on doing authz in middleware, but you can still get the row in one middleware, do the authz in another middleware, and then do request handling logic inside the request handler, for example.k.zgara
10/03/2024, 7:37 AMyetitwo
10/03/2024, 3:34 PM