Oct 9, 2022
It is definitely not simple. Nuances come into the picture when you dig into the actual implementation.
For your question,
The sharding key is - cluster+index which is used to determine to which cluster and index group the messages of a discord server go.
Now, when they want to scale, migration shouldn't be required because the new discord servers can point to the new clusters.
This determination of cluster is done keeping in account the amount of load that cluster is supporting.