Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gobwas committed Jun 27, 2021
1 parent b2a8296 commit f09eb6b
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@
# Overview

This is an implementation of the consistent hashing hashring data structure.
For more info please read the [docs][godoc-url].

In general, consistent hashing is all about mapping objects from a very big set
of values (e.g., request id) to objects from a quite small set (e.g. server
address). The word "consistent" means that it can produce consistent mapping on
different machines or processes without additional state exchange and
communication.

For more theory about the subject please see this [great
document][stanford-doc].

For more info about the package please read the [docs][godoc-url].

# The Why?

This is an approach for load distribution across servers which I found
convinient to be used in a few projects I had worked on in the past.

I think it is good to implement it from scratch to synthesize all of my
experience of work with it and share it with the community in hope it will help
to build something good.

Two values of this packages are:
1) Efficiency of concurrent read operations
2) Correct handling of write operations (the order of adding items on different
processes doesn't matter; hash collisions are kept in mind).

# Installation

Expand Down Expand Up @@ -50,7 +74,8 @@ func (s StringItem) WriteTo(w io.Writer) (int64, error) {
```


[godoc-image]: https://godoc.org/github.com/gobwas/hashring?status.svg
[godoc-url]: https://godoc.org/github.com/gobwas/hashring
[ci-badge]: https://github.com/gobwas/hashring/actions/workflows/main.yml/badge.svg?branch=main
[ci-url]: https://github.com/gobwas/hashring/actions/workflows/main.yml
[godoc-image]: https://godoc.org/github.com/gobwas/hashring?status.svg
[godoc-url]: https://godoc.org/github.com/gobwas/hashring
[ci-badge]: https://github.com/gobwas/hashring/actions/workflows/main.yml/badge.svg?branch=main
[ci-url]: https://github.com/gobwas/hashring/actions/workflows/main.yml
[stanford-doc]: https://theory.stanford.edu/~tim/s16/l/l1.pdf

0 comments on commit f09eb6b

Please sign in to comment.