By prefixing hash(version/1e6)
to the key instead of hash(version)
, all versions in a range of 1 million would be mapped next to each other. So, this scheme spreads chunks of 1 million versions across shards but still every million versions are range readable. Actual key stored on database would be something like this hash(version/1e6),version
.
1 Like