configurable prefix for consistent hashing?
nate at root.org
Wed Nov 9 14:48:33 EST 2011
We have been looking into ways to cluster keys to benefit from the LevelDB backend's prefix compression. If we were doing a batch of lookups and the keys from a given document could be grouped on a partition, they could be read with less disk IO. However, consistent hashing in Riak currently spreads keys randomly, based on SHA-1.
What I think we could really use is a per-bucket configurable prefix length for consistent hashing. We would then create keys of the form "DocumentID:<key>" and tell Riak to only hash DocumentID to get the partition. This way, keys from the same document would be clustered on the same partition.
Is this on your roadmap already? It seems like it wouldn't require too many changes to Riak.
More information about the riak-users