if it is for a single user, bulk check
# spicedb
j
if it is for a single user, bulk check is the recommendation, but is your plan to reload them everytime?
e
we'd need to reload them fairly frequently, as permissions will be changing on a an ad-hoc basis. so yes realistically on every app open we'd like to ensure we have the latest permission set
j
and the app is going to need to operate over 1K+ permissions locally?
e
yes unfortunately. around 17 permissions for upto 200 resources
j
17 permissions is okay; if it is for the same subject the system will auto-batch the resources by 100
so the above would be 34 checks total internally
so definitely use CheckBulk and make sure the same permission is in the same call
(you can add the others too)
e
okay thank you!
do you have any further advice if there was up to 6000 resources?
with around 20-30 req/s, we're seeing super high memory and CPU usage and unacceptable response times of over 5 seconds, and so realistically it's not going to be scalable for us to use bulk check as is.
j
6000 resources x 17 permissions?
e
yep exactly, we're aware it's really unwieldy 😅
also sorry for the late reply!
j
make 17 CheckBulk calls
unfortunately, the batching size limit right now is 100
so it would be 60 calls per
which is a lot
e
indeed, we found this out during our load testing! the plan is to move away from needing quite so many granular permissions in the app, as we've yet to find a solution that would work for us
j
it might be possible if we increased the batch check size
also, if the permissions have shared paths
if you make the bulk check at the same revision
it should reuse cache
2 Views