Global deployment with CockroachDB

Hello,

I’ve been exploring the options for global deployment of Hydra and it seems that the path of the least resistance (but not resistance-free, of course) is to use CockroachDB.

Let me quickly define what I mean by global deployment: multiple regions, some paired regions (in Azure terminology), global clients, ideally the tokens that could be used in multiple regions - at least in the ones that are close enough.

Opaque token implies that we would need very very quick DB lookup because it happens on each API call. I am new to CockroachDB but my understanding is that normally a read requires network roundtrip to the leaseholder. Leaseholder holds a lease for a specific range of keys, so, this potentially means constant roadtrips across the world for each token - the clients from the same range will be in different locations, randomly distributed.

So, here is the question: I see that CockroachDB has multiple topology recommendations, including the Follower Reads Topology. Are there any recommendations on CockroachDB configuration, topology or any other suggestions for such a scenario?

No idea unfortunately! https://github.com/lopezator has been quite active with Cockroach Labs so he might be able to answer that.

Hello Nikolai!

We have a similar setup, 3 regions (Eu, Asia, America), 3 nodes per region, 9 nodes in total.

We didn’t found major issues, just issue 1755 and we are on our way to fix it.

About the leaseholder concern, they offer features such as “follower reads”, “follow the workload”, “geo-partitioning” and many more to help in such scenarios.

I talked here about this (and also ORY Hydra) with CockroachDB team here:

Please, excuse my english, I know I have a strong spanish accent ;).

Anyway, I’m sure that CockroachDB team would guide you better than I, and they’ll answer happily any questions you could have.

https://cockroa.ch/slack

Hope this helps you.

Best,

David.

Hi David!

Thanks a lot for the comments an resources!