Consistent hashing डेटा को nodes (सर्वरों) में वितरित करने की एक तकनीक है जो nodes जोड़े या हटाए जाने पर redistribution को न्यूनतम करती है — सरल hashing के विपरीत, जो node count बदलने पर अधिकांश keys को remap करती है। यह distributed caches, databases, और load distribution के लिए महत्वपूर्ण है।
सरल hashing के साथ समस्या
Simple approach: node = hash(key) % N (N = number of nodes)
✗ when N CHANGES (add/remove a node), N changes → MOST keys remap to different nodes →
massive data movement / cache invalidation (almost everything moves!)
→ adding/removing a server causes huge disruption → bad for dynamic distributed systems.
