**Delay between write and read**
# spicedb
f
Delay between write and read We have a SpiceDB with Spanner datastore running on K8s. Version 1.42.0 I observe the following behaviour: When I write a relationship
zed relationship create
an then check permissions
zed permission check
it takes approx 5 - 10 sec until I get HAS_PERMISSION. The behaviour I would like to observe is that it takes something close to a second at best even less. I think I understood that it has to do with the hotspot caching and the quantization intervals. But I don't get which parameter I have to set, to make it work "faster"? Thanks for helpful hints!
v
👋This is by design. If you want to "read your writes", you have to fetch the zedtoken from
zed relationship create
and pass it to
zed permission check
We do not recommend making the quantization window smaller, as it means you'll be having more cache misses and loading more from the datastore
f
Ok, hmm and where do I stuff this token in the python library? Am I right, somehow in the context of the CheckPermissionRequest? Do you have an example?
y
Copy code
py
    resp = await maybe_await(
        client.CheckPermission(
            CheckPermissionRequest(
                resource=post_one,
                permission="view",
                subject=emilia,
                consistency=Consistency(at_least_as_fresh=ZedToken(token="some_token")),
            )
        )
    )
yes, it's one of the arguments
f
Thank you @yetitwo
3 Views