https://discord.com/channels/
# spicedb
v
@make it go faster CockroachDB needs to be tuned when used in a multi-region SpiceDB setup. On the default configuration the latencies are abysmal, becase of concensus across regions, as @Joey indicated, and the key-overlap strategy used by SpiceDB. CockroachDB does not offer strict serializable consistency like Spanner, so to address that, SpiceDB uses a strategy to cause serialization errors across non-overlapping key ranges, which can be tuned with the parameter @yetitwo indicated. This is what causes a big part of the bottleneck. Unfortunately SpiceDB cannot compromise on the new enemy problem, so it's up to the user to relax the parameters that enforce it if your application is not sensitive to it. Using the following configuration showed to address those latency issues: - ℹ️ to speed writes up, you need to enable insecure overlap, because it use
ON CONFLICT
and regions need to coordinate to reach out to the lease holder - ℹ️ you need to set
REGIONAL BY ROW
for
relational_tuple
table, as it yields the best results for workloads that have each region read and write their own tuples, effectively acting as independent regions. If this is not the case, you may need to look into a different configuration of the cluster. - ℹ️ strongly recommended using
GLOBAL
for
namespace_config
, as this table rarely sees changes, but only reads
m
thanks @vroldanbet @Joey for this insight. When we speak about key-overalp does that refer to the resource key, i.e when a relationship is being created on the same resource, since relationships on independent resources should not have any issues, correct?
Also when we apply the --datastore-tx-overlap-strategy. in the cluster file, it will need to be coverted into a camel case, is that correct like "datastoreTxOverlapStrategy" ?
j
yes
v
> When we speak about key-overalp does that refer to the resource key, i.e when a relationship is being created on the same resource, since relationships on independent resources should not have any issues, correct? no, we mean as "key" in the CockroachDB sense. Cockroach describes the concept of [ranges](https://www.cockroachlabs.com/docs/v24.3/architecture/overview#range), and ranges are roughly represented as key/values. You can read more about this in https://authzed.com/blog/prevent-newenemy-cockroachdb
9 Views