#consistent-hashing #node #node-key #load-balancer #distributed-systems #virtual #instance

bin+lib consistent_hasher

An implementation of consistent hashing, a technique commonly used in distributed systems to map keys (such as data items or requests) to nodes (e.g., servers or storage units) in a way that minimizes disruptions when nodes are added or removed

5 releases

new 0.1.5 Dec 17, 2024
0.1.4 Dec 16, 2024
0.1.1 Nov 21, 2024

#10 in #node-key

Download history 250/week @ 2024-11-18 20/week @ 2024-11-25 208/week @ 2024-12-02 26/week @ 2024-12-09

504 downloads per month

MIT/Apache

41KB
838 lines

LDB: Consistent Hashing Library

LDB is a Rust library that implements a consistent hashing system with support for virtual nodes, dynamic node and key management, and transaction tracking. It is ideal for distributed systems, load balancers, or caching mechanisms that require efficient and scalable key-to-node mapping.

Features

  • Dynamic Node Management: Add and remove nodes dynamically with minimal disruption.
  • Key Redistribution: Redistribute keys across nodes when the topology changes.
  • Transaction Tracking: Track redistribution transactions for audit and debugging purposes.
  • Virtual Nodes: Use virtual instances to improve load balancing.
  • Custom Hashers: Configure custom hashers using the set_hasher method.

Getting Started

Prerequisites

To use this library, you will need:

  • Rust (latest stable version recommended)
  • Basic knowledge of Rust traits and structures

Installation

Add the following to your Cargo.toml file:

[dependencies]
ldb = "0.1.0"

Dependencies

~0.4–1MB
~22K SLoC