All academies

Sharding Simulator

Insert documents through the mongos router and watch where they land. Compare shard key strategies, then run the balancer to migrate chunks.

Hashed key — writes spread evenly across all shards.

mongos

Query router

shard-0(0)

~1 chunks

shard-1(0)

~1 chunks

shard-2(0)

~1 chunks

Router log

› Cluster ready: mongos router → shard-0, shard-1, shard-2

What you're seeing

The mongos router uses cluster metadata to send each document to the shard owning its shard key range (chunk). Try the timestamp key and insert a batch: every write lands on the last shard — a classic hot shard caused by a monotonically increasing key. The balancer fixes uneven data volume by migrating chunks, but it cannot fix a bad key — only key choice controls where new writes go.