The Dgraph cluster is having the below server nodes. What’s the role of each server node in the cluster. Which server node is handling mutations and which server node is supporting reads.
Zero
Alpha
Dgraph is supporting verticle scaling by using sharding. How Dgraph is supporting sharding and can we configure custom sharding?
As far as custom sharding, there is nothing built in to dgraph to support this, however our team built a program that periodically calls a rpc to get every tablets location and runs a /moveTablet call to make sure each tablet is on the server we expect it to be on. Here are the zero http endpoints: https://dgraph.io/docs/deploy/dgraph-zero/#endpoints. Note that dgraph will automatically move shards around on you every 8m unless you override that setting. https://dgraph.io/docs/deploy/cluster-setup/#shard-rebalancing
Our use case for custom sharding is around multi-tenancy and making sure a customer is collocated with all of their predicates.
Regarding the brand new v21.03 multi-tenancy feature dgraph added, I do not think any special consideration is made for tenants wrt rebalancing - the built in rebalancing mechanism will move a tablet between Alpha groups every 8m if the alpha groups are un-balanced (based on size on disk).
With my company’s version of multi-tenancy, its just prefixing every predicate and sorting all of the tablets by prefix to allocate to a dgraph group.