Best setup for multiple Dgraph instances? (not on same provider)

I’ve got a Dgraph instance running on DigitalOcean, however now i’d like to get another instance running on AWS for example. Is there a guide for doing that, and is it even supported yet? Basically looking to get a geolocated setup between providers :slight_smile:

Any advice would be helpful. Thanks!

Note: I’m not using Kubernetes just yet, just plain old Droplets (DigitalOcean)/Instances (AWS) :slight_smile:

You should be able to point to any zero node when firing up an alpha node from what I understand so I guess you could do it across different services like that. Load balancing would be the tricky part though.


In the future will we be able to have multiple Dgraph master nodes or something? I’m guessing right now… we have to have all peer nodes connecting to 1 master node right? So my server in Asia would need to connect to my master in the U.S potentially (atm)?

It would be nice to be able to have an Asia peer connect to an Asia master, etc. Right? :slightly_smiling_face:

That is a little over my know how. I think I have seen setups with multiple zero nodes but not exactly sire the architecture. @MichelDiz didn’t you post something just here recently with an example of multiple zeroes?

1 Like

There is no guide for doing this in Bare metal instances. Perhaps using VPN for communication between the Zeros would be interesting. There is an internal interest in making Dgraph reliable for this issue of geographic regions. But it never went on.

It is a fact that the leader will always stay in a single region. And it may change regions if there are new elections. It is through Zero leader that all orchestration of Dgraph takes place. It is through Zero leader that UIDs are granted.

You can test this out. Use replicas across regions. It would be interesting to know how Dgraph works out in this context. But know that it has never been tested. At least as far as I know.

1 Like

@MichelDiz so multiple Zero leaders are possible? I haven’t seen any repo’s or guides on how that would work, or is even possible. Can you explain what you mean by “Use replicas across regions” … in terms of zeros/alphas? And in terms of architecture… i’m using Cloudflare Argo Tunnels at the moment for load balancing purposes. Potentially i’d like to have 3 zero’s and 3 alpha’s in a few different regions/zones, spread across the world. But if there can only be 1 zero leader… you would potentially have your alpha and zero’s having to make a request all the way back to the U.S for example (if the leader was in the U.S). That’s why I brought up about being able to have zero leader replicas (that synced between eachother I guess). If that makes sense?

Maybe @dmai @mrjn and other Dgraph core team members (sorry I don’t know everyone’s usernames) would like to chime in? :slightly_smiling_face:

no, I said, “It is a fact that the leader will always stay in a single region.” :stuck_out_tongue:

PS. I’ll get back to the other questions later.

1 Like

Replication is to avoid calls to other regions. If you have a full replica per region, that would be good. But I think you should set “replica=1 x Alphas”. Cuz if you have more than 1 (3, 5, 7), You would create N groups. Which in theory can be bad for latency across regions. Cuz a set of predicates could be “east” and other sets on the “west”. Unless there is a way to replicate groups that I’m not aware of. That way you could take advantage of sharding while having replication across regions.

Yep, that makes sense, but it is not possible as far as I know. Your cluster will rely on a single leader. No matter how much zeros you have appended.

The only way I see now is to use replica 1 x Alphas. (Your case is replica 7)

1 Like