Limits in the Number of ShardRegions in a Cluster

Hi all,
Is there any limit for the number of ShardRegions in a cluster? Any considerable performance issue could be happened?

In our design:

  • We need about 20 ShardRegions (in each DC),
  • Each ShardRegion lives in nodes with a specific role.

So let me describe our architecture:

Suppose we want to serve 100 million users. But, our database can serve up to 1 million users. So we have to divide users into several segments and each segment connects to its own database.

To do this, we divided the cluster nodes into several segments, each of which is responsible for hosting 1 million users. We divided the nodes by breaking the user-ShardRegion into several smaller ShardRegions and assigning a special role to them. This means that instead of having a ShardRegion for all users, every 1 million users have a ShardRegion.

For users with an ID of 1 to 1 million, we have a ShardRegion called “users1”, which lives on nodes with a “user-role-1” role. These nodes are connected to the database with the address “users1.db”.

So for 100 million users we need 100 ShardRegions and 100 cluster roles.

We also want to have a separate data center for every 20 million users. So we will have a Multi-DC cluster with 5 data centers; In each DC we have 20 ShardRegions and 20 cluster roles.