consistenHashing

command module
v0.0.0-...-e8903b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 6 Imported by: 0

README


Consistent Hashing Implementation with Circular Linked List

This is a simple Go implementation of consistent hashing using a circular linked list. It aims to distribute data evenly across nodes using hash values.

Overview

Consistent hashing is a technique used in distributed systems to ensure even data distribution and load balancing. This implementation utilizes a circular linked list to organize nodes in a hash ring, where data or resources can be mapped to nodes based on their hash values.

Usage

  1. Clone the repository:

    git clone https://github.com/yourusername/consistent-hashing.git
    cd consistent-hashing
    
  2. Build and run the program:

    go build
    ./consistent-hashing
    
  3. Modify the code as needed for your use case.

Code Structure

  • main.go: Contains the main implementation of the circular linked list-based consistent hashing.
  • hash.go: Defines the Hasher interface and provides a hash service using SHA-3.

Implementation Details

  • The RingService struct manages the circular linked list and node placement.
  • The HashService struct provides hashing and distance calculation using SHA-3 and big.Int.
  • Nodes are placed on the ring next to the node with the smallest distance, aiming to achieve even distribution.

Contributing

Contributions are welcome! If you find issues or want to enhance the implementation, feel free to create a pull request.

License

This project is licensed under the MIT License.


Feel free to customize the template according to your project's details and specific requirements. Make sure to provide clear instructions for setting up and using your consistent hashing implementation.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL