March 2019
Intermediate to advanced
394 pages
11h 4m
English
There is no command or simple procedure to change the shard key in MongoDB. The only way to change the shard key involves backing up and restoring all of our data, something that may range from being extremely difficult to impossible in high-load production environments.
The following are the steps that we need to go through in order to change the shard key:
Of these steps, step 4 is the one that needs further explanation.
MongoDB uses chunks to split data in a sharded collection. If we bootstrap a MongoDB sharded cluster from scratch, chunks will ...
Read now
Unlock full access