ketama 0.0.1

Ketama consistent hash ring compatible with libmemcached/twemproxy
Documentation
  • Coverage
  • 90%
    9 out of 10 items documented0 out of 9 items with examples
  • Size
  • Source code size: 32.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.69 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ringline-rs/ketama
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • brayniac

ketama

Ketama consistent hash ring compatible with libmemcached/twemproxy.

A zero-dependency implementation of the ketama consistent hashing algorithm. Adding or removing a server remaps only ~1/N of keys instead of all keys.

Features

  • MD5-based virtual nodes (160 per server at weight 1)
  • Weighted node support
  • Compatible with libmemcached/twemproxy ketama algorithm
  • Zero external dependencies

Usage

[dependencies]
ketama = "0.0.1"
use ketama::Ring;

// Build a ring with 3 servers
let ring = Ring::build(&["server1:11211", "server2:11211", "server3:11211"]);

// Route a key to a server index
let shard = ring.route(b"my-cache-key");

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.