Skip to content

Instantly share code, notes, and snippets.

View AnanthaRaam's full-sized avatar
🎯
Focusing

Anantha Raam G AnanthaRaam

🎯
Focusing
View GitHub Profile
@AnanthaRaam
AnanthaRaam / hash_ring.py
Created November 14, 2020 18:08 — forked from soekul/hash_ring.py
Consistent hash implementation in Python.
# -*- coding: utf-8 -*-
"""
hash_ring
~~~~~~~~~~~~~~
Implements consistent hashing that can be used when
the number of server nodes can increase or decrease (like in memcached).
Consistent hashing is a scheme that provides a hash table functionality
in a way that the adding or removing of one slot
does not significantly change the mapping of keys to slots.