Looking at sharding techniques, you basically have hash-based or range-based versions. Hash based is more random, range-based is more heuristic based. Say you initially have 2 shards (separate database instances), then you outgrow it and would require 3 shards. What do you do, now your hash stuff won't work anymore, you basically need to recompute the position of every record (say there are 10 billion records). And range sharding won't transfer either, you'd have to give more weight potentially to the new shard, but that wouldn't really be ideal either so in this case you would also have to recompute record locations.
Am I thinking about this correctly? Then say at your current growth rate, you should ideally add 2 more shards for a total of 5, then 3 more for a total of 8. Each time you would have to re-scatter all the records, correct?
If so, what happens in practice when you need to do this readjustment? I have never dealt with databases needing this level of complexity. Is the database usable during this time? How do you both transfer the records to the new sharding scheme, and at the same time allow your database to be read from and written to?