I need some help finding or creating a consistent hashing algorithm with the following properties:
- Given N buckets, only distributes keys to bucket N.
- When number of buckets are increased from N to N+1, only keys in N have to be migrated to N+1.
- When number of buckets are reduced from N to N-1, only keys in N are migrated to N-1
More context, I'm building a distributed hash table on an environment, where reliability is not an issue, it's guaranteed that each node would be up, and not added or removed unpredictably (I control the nodes being added or removed)
I don't want replication (replication of data is handled at a lower level), Also when nodes are removed, they can only be removed in a LIFO manner (node 2, cannot be removed before node 3)
I would appreciate any insight into this, and literature suggestions.