Hi, I have the spicedb running in the
# spicedb
y
Hi, I have the spicedb running in the local docker container, and using Postgres as the database engine. If I write the relationship and then after immediately checkthe permission it returns as 'no permission', but if check the permission after 5 sec it returns me 'has permission', I am using @authzed/authzed-node to write and check permissions. What am I doing wrong, please help.
v
hi, this is working as intended. SpiceDB has a tunable consistency model, and if you are not specifying anything, SpiceDB defaults to
minimize_latency
strategy, which has a window of 5 seconds by default of staleness. If you need "read your writes" consistency, then you need to take the
ZedToken
from the
WriteRelationships
request and pass it in your
CheckPermission
cal with consistency
at_least_as_fresh
y
can i use fully_consistent ?
y
you can, but it's not something you should generally be doing. it will always force a database read, so your scaling becomes limited by your datastore and you don't get to take advantage of spicedb's caching mechanisms which will limit its ability to scale.
3 Views