We have 4 datacenters that we wish to run CockroachDB in, us-east, us-west, us-central, europe-west. I’m curious if there are any tips on how to avoid the europe-west latency in writes. We are running all of the nodes with “–locality continent=${CONTINENT},region=${REGION}”. We are testing out CockroachDB for our sessions storage. We have around 1-2k sessions updates/inserts per second right now with around 40% coming from Europe and 60% from US. We see around 30-40 sessions migrate between US<->Europe every second but for the most part sessions on one continent stay on that continent.
Specifically, a problem I envision is that since ranges are made up randomly with data a range can’t effectively be assigned a leaseholder in the most likely area of writes/reads. I haven’t found a way for us to tell CockroachDB about the relative locality of rows so it can try to keep alike rows (based on region of the session) in the same range. I read the “Follow-the-workload” but I’m concerned that since roughly half of requests would come from different regions, it won’t be able to effectively maintain a leaseholder in the best region.
If there isn’t a way to specify anything that affects the hash for ranges, would a table per region/dc make more sense then? Could we store the table name in the sessionID and then use that to do lookups in the correct table, which would then mostly contain rows from users in that region, and allow leaseholders to be more likely in the right region?
I also might be misunderstanding something about ranges or CockroachDB in general, so any clarity is greatly appreciated.