Let’s say my current DynamoDB has 2 partitions. The data is divided based on the hash of the partition key. Given that there are only 2 partitions, hashes starting from 00xx to 80xx goes to partition 1 and 81x to FFxx goes to partition 2. If I change my Read and Write capacity or storage size, let’s suppose that now I have 3 partitions. Now we have 00xx-55xx on partition 1, 56xx-AAxx on partition 2, and ABxx-FFxx on partition 3.
In this scenario, for instance, some of the items of partition 2 should be moved to partition 3 because now their hash will map to partition 3. How does Dynamo handles that? Does that reflects in performance while moving data?
Dynamo shuffles data between partitions behind the scenes. I’m sure there is a minor performance impact but remember that Dynamo has an eventual consistency model and it can do stuff async…unlike an traditional RDBMS that would likely lock rows or tables when re-partitioning.
Keep in mind that it only scales out to more partitions automatically. So if you bump up your RCU or WCU drastically, you’ll get lots more partitions…all taking a slice of the available RCU/WCU. If you then reduce RCU/WCU, your partitions remain and they too each take an equal slice of the available RCU/WCU.