# Consistent hashing algorithm

DevFeed: [Consistent hashing algorithm](<https://devfeed.tech/articles/consistent-hashing-algorithm-27905.md>)

Original publisher: [Read original article](<http://highscalability.com/blog/2023/2/22/consistent-hashing-algorithm.html>)

Author: NK

Published: 2023-02-22T16:39:15Z

Content type: tutorial

Language: en

Sources: [High Scalability](<https://devfeed.tech/sources/high-scalability.md>), [High Scalability](<https://devfeed.tech/sources/high-scalability-2.md>)

Topics: [hashing](<https://devfeed.tech/topics/hashing.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>), [Software](<https://devfeed.tech/topics/software.md>), [Availability](<https://devfeed.tech/topics/availability.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [availability](<https://devfeed.tech/tags/availability.md>), [cache](<https://devfeed.tech/tags/cache.md>), [consistent-hashing](<https://devfeed.tech/tags/consistent-hashing.md>), [distributed-system](<https://devfeed.tech/tags/distributed-system.md>), [hashing](<https://devfeed.tech/tags/hashing.md>), [hotspot](<https://devfeed.tech/tags/hotspot.md>), [load-balancing](<https://devfeed.tech/tags/load-balancing.md>), [low-latency](<https://devfeed.tech/tags/low-latency.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [sharding](<https://devfeed.tech/tags/sharding.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>)

## AI overview

A tutorial explaining consistent hashing: nodes and data keys are mapped onto a virtual hash ring, and clockwise traversal assigns data to nodes. It discusses terminology, cache-server scaling requirements, hotspot reduction, dynamic load, replication, availability, and latency.

## Source excerpt

This is a guest article by NK. You can view the original article Consistent hashing explained on systemdesign.one website. How does consistent hashing work? At a high level, consistent hashing performs the following operations: The output of the hash function is placed on a virtual ring structure (known as the hash ring) The hashed IP addresses of the nodes are used to assign a position for the nodes on the hash ring The key of a data object is hashed using the same hash function to find the position of the key on the hash ring The hash ring is traversed in the clockwise direction starting from the position of the key until a node is found The data object is stored or retrieved from the node that was found Terminology