Skip to content

afirel/consistent_hashr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConsistentHashr

A small module to do easy consistent hashing.

Usage

ConsistentHashr.add_server(“s1”, “server1”) ConsistentHashr.add_server(“s2”, “server2”) ConsistentHashr.add_server(“s3”, “server3”) ConsistentHashr.add_server(“s4”, “server4”) ConsistentHashr.add_server(“s5”, “server5”)

ConsistentHashr.get(key) # Should return the same key consistently when new servers are added.

Implementation

Based on “Mike Perham’s”:www.mikeperham.com/ “code”:www.mikeperham.com/2009/01/14/consistent-hashing-in-memcache-client/ and tests. I thought this layer didn’t belong to any specific client, this is why I extracted it.

Greatly inspired by “Tom White’s consistent hashing explaination”:weblogs.java.net/blog/tomwhite/archive/2007/11/consistent_hash.html.

About

A Consistent Hashing implementation for Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published