You don’t need necessarily set the shards num. Dgraph will balance the groups between the Raft group after the cluster is up. You can use them if you need this to be done already.
Basically if you have 4 shards*. You need to use each shard within specific groups. According to the number of replicas.
4 shards are for 3 replicas per group and 12 Alphas.
You can’t use shards output randomly. So I think it’s better for those who are just starting out, just use a single shard and let Dgraph alone do the rest of the work.
If you need to undestand this check the links