Welcome to the MongoDB Community @FEDERICA_BO!
Practical limits & thresholds to consider are documented in the MongoDB Limits and Thresholds page that @ado shared earlier.
The table you are referring to is specific to Sharding Existing Collection Data Size and per the Important callout for this section, this limitation only applies to initial sharding:
These limits only apply for the initial sharding operation. Sharded collections can grow to any size after successfully enabling sharding.
Collections are generally sharded well before reaching those collection sizes. Rebalancing TBs of data will take a long while even with great server & network resources. It is best to shard well before it becomes urgent to do so, as data migration will add even more load to a deployment that is already stressed.
The estimation of these limits is explained just above the table. When a collection is initially sharded, a calculation is done to determine how to split existing data into chunk ranges based on the shard key with each range representing data sizes close to the configured Chunk Size. A list of initial split points is currently returned in a single BSON document which is subject to the 16MB document size limit.
What that table is trying to estimate is the size of collections that can be sharded based on varying shard key sizes or chunk sizes:
Use the following formulas to calculate the theoretical maximum collection size.
maxSplits = 16777216 (bytes) / maxCollectionSize (MB) > maxSplits * (chunkSize / 2)
Chunk Size should be left at the default value (64MB) unless you have specific motivation to change this (for example, if you waited too long to shard and need a larger chunk size for initial sharding
). There is no configuration for shard key size: the average size of shard key values will depend on the field(s) you choose for your shard key index and the associated values in the collection being sharded.
For more background on practical vs theoretical limits, please see my response on this earlier discussion: Database and collection limitations - #2 by Stennie_X.
If you are concerned about managing capacity planning and scaling yourself, MongoDB Atlas would be a significant help with features like Cluster Auto-Scaling and the ability to adjust cluster resources based on your current requirements.
Regards,
Stennie