All Projects → domnikl → consistent-hashing

domnikl / consistent-hashing

Licence: other
an implementation of Consistent Hashing in pure Ruby using an AVL tree

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to consistent-hashing

distributed-dev-learning
汇总、整理常用的分布式开发技术,给出demo,方便学习。包括数据分片、共识算法、一致性hash、分布式事务、非侵入的分布式链路追踪实现原理等内容。
Stars: ✭ 39 (-2.5%)
Mutual labels:  distributed-systems, consistent-hashing
golearn
🔥 Golang basics and actual-combat (including: crawler, distributed-systems, data-analysis, redis, etcd, raft, crontab-task)
Stars: ✭ 36 (-10%)
Mutual labels:  distributed-systems
matrixone
Hyperconverged cloud-edge native database
Stars: ✭ 1,057 (+2542.5%)
Mutual labels:  distributed-systems
awesome-list-of-awesomes
A curated list of all the Awesome --Topic Name-- lists I've found till date relevant to Data lifecycle, ML and DL.
Stars: ✭ 259 (+547.5%)
Mutual labels:  distributed-systems
zimfarm
Farm operated by bots to grow and harvest new zim files
Stars: ✭ 58 (+45%)
Mutual labels:  distributed-systems
clock
Logical clocks implementation in Rust
Stars: ✭ 37 (-7.5%)
Mutual labels:  distributed-systems
pat-helland-and-me
Materials related to my talk "Pat Helland and Me"
Stars: ✭ 14 (-65%)
Mutual labels:  distributed-systems
MIT6.824-2017-Chinese
A Chinese version of MIT 6.824 (Distributed System)
Stars: ✭ 67 (+67.5%)
Mutual labels:  distributed-systems
gen browser
Transparent bi-directional communication for clients, servers and more
Stars: ✭ 67 (+67.5%)
Mutual labels:  distributed-systems
dynamic-sharding
用动态分片解决pushgateway高可用 单点 HA问题
Stars: ✭ 27 (-32.5%)
Mutual labels:  consistent-hashing
ray tutorial
An introductory tutorial about leveraging Ray core features for distributed patterns.
Stars: ✭ 67 (+67.5%)
Mutual labels:  distributed-systems
pylm
A framework to build components for high performance distributed applications.
Stars: ✭ 14 (-65%)
Mutual labels:  distributed-systems
Anubis
Distributed LMS for automating Computing Science Courses From NYU
Stars: ✭ 184 (+360%)
Mutual labels:  distributed-systems
Learning-Notes
some notes on learning C++, Go, UNIX, Database and Distributed System
Stars: ✭ 24 (-40%)
Mutual labels:  distributed-systems
nkn-shell-daemon
NKN shell daemon
Stars: ✭ 29 (-27.5%)
Mutual labels:  distributed-systems
MIT6.824-2021
4 labs + 2 challenges + 4 docs
Stars: ✭ 594 (+1385%)
Mutual labels:  distributed-systems
nact
nact ⇒ node.js + actors ⇒ your services have never been so µ
Stars: ✭ 1,003 (+2407.5%)
Mutual labels:  distributed-systems
protoactor-go
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 4,138 (+10245%)
Mutual labels:  distributed-systems
TUMGAD
Exercise generator and helpful materials for the Introduction to Algorithms and Data Structures 📚
Stars: ✭ 27 (-32.5%)
Mutual labels:  avl-tree
traffic
Massively real-time traffic streaming application
Stars: ✭ 25 (-37.5%)
Mutual labels:  distributed-systems

consistent-hashing

A generic implementation of the Consistent Hashing algorithm using an AVL tree.

2019-10-19 I archived this project as there hasn't been any recent activity and I have moved on to other projects. You can still download and use it though.

Features

  • set number of replicas to create multiple virtual points in the ring for each node
  • nodes can be arbitrary data (e.g. a Memcache client instance)
  • fast performance through using an AVL tree internally

Examples

require 'consistent_hashing'

ring = ConsistentHashing::Ring.new
ring << "192.168.1.101"
ring << "192.168.1.102"

ring.node_for("foobar") # => 192.168.1.101
ring.delete("192.168.1.101")

# after removing 192.168.1.101, all keys previously mapped to it move clockwise to
# the next node
ring.node_for("foobar") # => 192.168.1.102

ring.nodes # => ["192.168.1.101", "192.168.1.102"]
ring.points # => [#<ConsistentHashing::VirtualPoint>, #<ConsistentHashing::VirtualPoint>, ...]

Installation

  • [sudo] gem install consistent-hashing

Author

Original author: Dominik Liebler [email protected]

License

(The MIT License)

Copyright (c) 2013 - 2019 Dominik Liebler

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].