Limited Time Offer:Up to 20% off Hello Interview Premium
Up to 20% off Hello Interview Premium 🎉
Hello Interview
Learn System Design
Introduction
How to Prepare
Delivery Framework
Core Concepts
Key Technologies
Common Patterns
Question Breakdowns
Networking Essentials
API Design
Data Modeling
Caching
Sharding
Consistent Hashing
Quick Reference
CAP Theorem
Database Indexing
Numbers to Know
Bitly
Dropbox
Local Delivery Service
Ticketmaster
FB News Feed
Tinder
LeetCode
WhatsApp
Rate Limiter
FB Live Comments
FB Post Search
YouTube Top K
Uber
YouTube
Web Crawler
Ad Click Aggregator
News Aggregator
Yelp
Strava
Online Auction
Price Tracking Service
Instagram
Robinhood
Google Docs
Distributed Cache
Job Scheduler
Payment System
Metrics Monitoring
ChatGPT
Real-time Updates
Dealing with Contention
Multi-step Processes
Scaling Reads
Scaling Writes
Handling Large Blobs
Managing Long Running Tasks
Redis
Elasticsearch
Kafka
API Gateway
Cassandra
DynamoDB
PostgreSQL
Flink
ZooKeeper
Time Series Databases
Data Structures for Big Data
Vector Databases
Vote For New Content
Pricing
Sign in / Sign up
Search
⌘K
Pricing

Tutor

Hello InterviewQuick Reference
Full Article
Quick Reference

Consistent Hashing

Interview Use

Use managed systems

Most modern distributed systems handle sharding and data distribution for you.

Go deep for infrastructure

Distributed databases, caches, and message brokers are the common from-scratch prompts.

Avoid custom implementation

Most interviews only need to acknowledge that existing solutions handle this complexity.

Distribution Choice

Modulo Hashing uses hash(key) % node count and redistributes most data on membership changes; Consistent Hashing maps keys and nodes to a ring and walks clockwise to minimize redistribution.
  • Modulo Hashing: Use hash(key) % node count; adding or removing a node redistributes most data.
  • Consistent Hashing: Hash keys and nodes onto a ring; walk clockwise to the next node to minimize redistribution.

Hash Ring

Lookup Flow

1

Create the hash ring

Use a fixed circular hash space for both data and servers.

2

Place server nodes

Map each database, cache, broker, or app server to positions on the ring.

3

Route each key

Hash the key, find its point, then move clockwise until a node is found.

Membership Changes

Adding a Node moves only the range claimed by the new node; Removing a Node moves only keys mapped to that node to the next clockwise node.
  • Adding a Node: Only the new node's claimed range moves; all other keys stay put.
  • Removing a Node: Only keys mapped to the removed node move; they remap to the next clockwise node.

Load Balance

Virtual Node Effects

Virtual Nodes place each database at many ring positions; Failure Spread sends failed ranges to multiple remaining databases; New Node Spread absorbs small chunks from multiple existing nodes.
  • Virtual Nodes: Hash multiple variations of each database name to place it at many ring positions.
  • Failure Spread: A failed node's ranges redistribute across multiple remaining databases, not one neighbor.
  • New Node Spread: A new database absorbs small chunks from multiple existing nodes from the start.

Hot Spot Fixes

Read Replicas are the most common hot spot fix and load-balance reads across replicas; Key-Space Salting scatters hot keys with suffixes; Adaptive Rebalancing moves key ranges using traffic monitoring.
  • Read Replicas: Most common approach; replicate hot keys and load-balance reads across nodes.
  • Key-Space Salting: Append random suffixes to hot keys so reads scatter across nodes and aggregate.
  • Adaptive Rebalancing: Operationally complex; monitor traffic and move specific key ranges off overloaded nodes.

Real World

Apache Cassandra uses consistent hashing to distribute data across the ring; Amazon DynamoDB uses it for partition placement; Content Delivery Networks use it to choose an edge cache server.
  • Apache Cassandra: Uses consistent hashing to distribute data across the ring.
  • Amazon DynamoDB: Uses consistent hashing under the hood for partition placement.
  • Content Delivery Networks (CDNs): Use consistent hashing to choose which edge server should cache content.

Your account is free and you can post anonymously if you choose.

Reading Progress

On This Page

Interview Use

Distribution Choice

Hash Ring

Lookup Flow

Membership Changes

Load Balance

Virtual Node Effects

Hot Spot Fixes

Real World

Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103


© 2026 Optick Labs Inc. All rights reserved.