Quoting from Dgraph paper at Dgraph Whitepapers: In-Depth Insights and Analysis,
Dgraph consists of Zeros and Alphas, each representing a group that they are serving. Each group is a Raft Cluster of an odd number of members. Zeros store and propagate metadata about the cluster while Alphas store user data.
As mentioned in Consistent Replication section of Cluster Setup - Deploy, it is recommended to use odd number of zeros and alphas for maintaining consensus among the group.
Alphas listen to Zero group (the Raft cluster) as a whole. In a Raft cluster, every write is consistently replicated to the group. No matter which zero you query, you will get the same response.
Quoting from paper, Zeros store and propagate metadata about the cluster while Alphas store user data.
In case data is posted to a follower Alpha, it will be propagated and replicated to leader Alpha.
The --peer parameter is used to point out the Zero cluster to the Alpha. In the given example, as both zeros belong to the same Zero group (Raft cluster), the result will be same as setting both Alphas to the leader Zero.
As long as you set Alpha’s --zero flag to a Zero in the cluster, it first connect to that Zero and then make a connection to the current Zero leader for updates.
You can also set multiple Zero addresses for that option:
In which case, it will try to connect with any one of these Zeros to connect with the cluster and, once connected, will make a connection with the current Zero leader.
For Zeros, many of its admin commands require them to be done on the leader.
Okay this clears up a lot on how Zeroes work together in a cluster. I will add a third Alpha and Zero as the documentation suggests. Thanks Rajas and Daniel!