समरूपहैशः। आशावादीबन्धे (९ अक्टो) संघर्षः। अत्र कुञ्चिका कस्मिन् नोडे। ring, vnode, remap। न mod-N नृत्यम्; समरूपधर्मः।
English (minimizable)
After optimistic concurrency (9 Oct), this post covers consistent hashing: ring placement, virtual nodes, minimal rebalance, replication along the ring, key choice, hot keys, shared membership and cache moves.
पूर्ण-शीर्षकम् / Full title
समरूपहैशः: A Metrical Codification of Consistent Hashing (with English glosses)
English · overview and topics (minimizable)
What this post is about
Consistent hashing assigns keys to nodes so cluster membership changes move only a small fraction of keys.
Topics covered
- Pain of hash%N on resize
- Hash ring model
- Virtual nodes
- Minimal rebalance
- Replica successors
- Stable business keys
- Hot-key limits
- Shared algorithm/membership
- Cache invalidation on move
- Tenant hashing / cells
Sanskrit title
समरूपहैशः = samarūpa-haiśaḥ “consistent/uniform hash”.
English
Minimizable; Sanskrit-first.
परम्परा-सन्धिः / Series links
| पूर्वं / Prior | अत्र / Adds | न पुनः / Does not repeat |
|---|---|---|
| बहुकिरायविवेकः (८ सितम्बे) | tenant isolation | tenant as hash key |
| सञ्चयधर्मः (७ सितम्बे) | caches | key remap invalidation |
| वाचनप्रतिलिपिः (६ अक्टो) | replicas | different from ring replicas |
| क्षमतायोजना (१५ जुलै) | capacity | rebalance planning |
| इदम् | ring vnode minimal remap | - |
ग्राह्य-त्याज्य-विवेकः / Keep and avoid
ग्राह्यम् / Keep
१. shared ring view: same algo+membership
२. vnodes: smooth load
३. stable key: business id not random each call
४. R successors: document replica placement
५. hot-key plan: salt/split/cache
६. transition reads: dual-read or invalidate
७. ops runbook: node join/leave steps
त्याज्यम् / Avoid
- hash%N as only shard plan on elastic clusters
- different clients with different vnode counts
- ignore hot keys
अध्याय-योजना / Chapter plan
| प्रकरणम् | विषयः | छन्दः | श्लोकाः |
|---|---|---|---|
| १ | मङ्गलं बीजं च / Opening | अनुष्टुभ् | २ |
| २ | मूलतत्त्वानि / Core | अनुष्टुभ् | २ |
| ३ | मुख्यविधिः / Method | उपजाति | १ |
| ४ | रक्षा · विधिः / Guards | अनुष्टुभ् | २ |
| ५ | विवेक · सीमा / Judgment | अनुष्टुभ् | २ |
| ६ | पूर्वसन्धिः / Series links | उपजाति | १ |
| ७ | उपसंहारः / Close | अनुष्टुभ् | २ |
पारिभाषिक-कोशः / Glossary
| Modern English | संस्कृतम् | Note |
|---|---|---|
| consistent hashing | समरूपहैशः / सुसंगतहैश | |
| hash ring | हैशवलयः | |
| virtual node | वर्चस्विनोड / vnode | |
| rebalance | पुनर्वितरणम् | |
| shard | खण्डः / शार्ड् | |
| hot key | उष्णकुञ्चिका | |
| membership | सदस्यतादृश्यम् | |
| rendezvous hashing | मिलनहैशवर्गः | alternative |
| partition | विभागः | |
| data movement | दत्तांशचालनम् |
श्लोकः १ (अनुष्टुभ्)
समरूपहैशस्तस्माद् मितपुनर्वितरणम् ॥१॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
यदा पात्राणि वर्धन्ते ह्रसन्ति च तदा मानचित्रणं कम्पते ।
समरूपहैशस्तस्माद् मितपुनर्वितरणम् ॥१॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| यदा | when |
| पात्राणि | vessels/nodes |
| वर्धन्ते | grow |
| ह्रसन्ति | shrink |
| मानचित्रणम् | mapping |
| कम्पते | shakes |
| समरूपहैशः | consistent hash |
| मितपुनर्वितरणम् | small redistribution |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| पात्राणि | nodes/shards |
| समरूपहैशः | consistent hashing |
| मितपुनर्वितरणम् | minimal remap |
English sense
Consistent hashing maps keys to nodes so adding or removing a node moves only a fraction of keys not almost all of them as in naive mod-N.
Context / topic
Topic: why consistent hashing.
वृत्तमिति: ८-८-८-८।
श्लोकः २ (अनुष्टुभ्)
घड़ीदिशा निकटं नयेत् ॥२॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
वृत्तं बिन्दवः नोडाः कुञ्चिकाश्च ।
घड़ीदिशा निकटं नयेत् ॥२॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| वृत्तम् | ring |
| बिन्दवः | points |
| नोडाः | nodes |
| कुञ्चिकाः | keys |
| घड़ीदिशा | clockwise |
| निकटम् | nearest |
| नयेत् | leads |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| वृत्तम् | hash ring |
| घड़ीदिशा | clockwise walk |
English sense
Classic picture: hash nodes and keys onto a ring; each key belongs to the next node along the ring.
Context / topic
Topic: ring model.
वृत्तमिति: ८-८-८-८।
श्लोकः ३ (अनुष्टुभ्)
एकबिन्दुनोडः विषमः ॥३॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
virtual nodes भारं समं कुर्युः ।
एकबिन्दुनोडः विषमः ॥३॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| virtual | virtual |
| nodes | nodes |
| भारम् | load |
| समम् | even |
| कुर्युः | should make |
| एकबिन्दुनोडः | one-point node |
| विषमः | uneven |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| virtual nodes | vnodes |
| विषमः | skewed |
English sense
Many virtual nodes per physical server smooth load when node counts are small or heterogeneous.
Context / topic
Topic: virtual nodes / load balance.
वृत्तमिति: ८-८-८-८।
श्लोकः ४ (अनुष्टुभ्)
mod N सर्वं नृत्यति ॥४॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
पुनर्वितरणं केवलं पड़ोसीषु ।
mod N सर्वं नृत्यति ॥४॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| पुनर्वितरणम् | rebalancing |
| केवलम् | only |
| पड़ोसीषु | among neighbors |
| mod | mod |
| N | N |
| सर्वम् | everything |
| नृत्यति | dances |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| पड़ोसीषु | neighbors only |
| mod N | modulo sharding |
English sense
On node join/leave only nearby key ranges move. Naive hash%N reshuffles almost every key when N changes.
Context / topic
Topic: rebalance cost.
वृत्तमिति: ८-८-८-८।
श्लोकः ५ (उपजाति)
अनन्तरनोडेषु ।
एकनाशे
डेटा मा नश्यतु ॥५॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
replication factor घड़ीदिशा
अनन्तरनोडेषु ।
एकनाशे
डेटा मा नश्यतु ॥५॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| replication | replication |
| factor | factor |
| घड़ीदिशा | clockwise |
| अनन्तरनोडेषु | on next nodes |
| एकनाशे | when one dies |
| डेटा | data |
| मा नश्यतु | must not perish |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| replication factor | copies along ring |
| एकनाशे | one node death |
English sense
Stores often place R successors as replicas so one node loss still leaves copies. Document repair and hinted handoff separately.
Context / topic
Topic: replication on the ring.
वृत्तमिति: एकादशाक्षराः पादाः।
श्लोकः ६ (अनुष्टुभ्)
userId हैशः श्रेयान् स्मृतेः ॥६॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
कुञ्चिका स्थिरता session stickiness न ।
userId हैशः श्रेयान् स्मृतेः ॥६॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| कुञ्चिका | key |
| स्थिरता | stability |
| session | session |
| stickiness | stickiness |
| न | not enough alone |
| userId | user id |
| हैशः | hash |
| श्रेयान् | better |
| स्मृतेः | than mere memory |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| stickiness | LB cookie sticky |
| userId हैशः | hash of stable id |
English sense
Prefer hashing a stable business key for shard choice. Pure cookie stickiness breaks when peers change unless the ring is shared.
Context / topic
Topic: key choice for affinity.
वृत्तमिति: ८-८-८-८।
श्लोकः ७ (अनुष्टुभ्)
शार्ड् salting वा कोष्ठः ॥७॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
hot key एकनोडं दह्यते ।
शार्ड् salting वा कोष्ठः ॥७॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| hot | hot |
| key | key |
| एकनोडम् | one node |
| दह्यते | burns |
| शार्ड् | shard |
| salting | salting |
| कोष्ठः | bulkhead/cell |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| hot key | popular key |
| salting | key salt/split |
English sense
Consistent hashing does not fix hot keys. Split celebrity keys, cache them or add local capacity.
Context / topic
Topic: hot-key limits.
वृत्तमिति: ८-८-८-८।
श्लोकः ८ (अनुष्टुभ्)
भिन्ना हैशकथा द्विधा ॥८॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
client library ring सत्यं सह ।
भिन्ना हैशकथा द्विधा ॥८॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| client | client |
| library | library |
| ring | ring |
| सत्यम् | truth |
| सह | shared |
| भिन्ना | different |
| हैशकथा | hash story |
| द्विधा | twofold wrong |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| client library | smart clients |
| द्विधा | split brain routing |
English sense
All clients and proxies must share algorithm, vnode count and membership view or they route differently.
Context / topic
Topic: shared membership/algorithm.
वृत्तमिति: ८-८-८-८।
श्लोकः ९ (अनुष्टुभ्)
पुराननोडे जीर्णसत्यम् ॥९॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
cache invalidation ring सह चलतु ।
पुराननोडे जीर्णसत्यम् ॥९॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| cache | cache |
| invalidation | invalidation |
| ring | ring |
| सह | with |
| चलतु | must move |
| पुराननोडे | on old node |
| जीर्णसत्यम् | stale truth |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| cache invalidation | on remap |
| जीर्णसत्यम् | stale on old node |
English sense
When keys move, invalidate or dual-read during transition windows so users do not see split stale/fresh.
Context / topic
Topic: migration windows. Links to cache dharma.
वृत्तमिति: ८-८-८-८।
श्लोकः १० (उपजाति)
हैशकुञ्चिकायां वहेत् ।
एककुटुम्बः
एककोष्ठाय ॥१०॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
बहुकिरायविवेकः कुटुम्बं
हैशकुञ्चिकायां वहेत् ।
एककुटुम्बः
एककोष्ठाय ॥१०॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| बहुकिरायविवेकः | multi-tenant dharma |
| कुटुम्बम् | tenant |
| हैशकुञ्चिकायाम् | in hash key |
| वहेत् | should ride |
| एककुटुम्बः | one tenant |
| एककोष्ठाय | to one cell |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| कुटुम्बम् | tenant |
| एककोष्ठाय | toward one cell |
English sense
Often hash tenant_id so one tenant lands in one cell for isolation and quieter noisy-neighbor math with hot-tenant care.
Context / topic
Topic: tenancy + hashing.
सन्धिः: किरायः कुञ्चिका; हैशः नोडः।
वृत्तमिति: एकादशाक्षराः पादाः।
श्लोकः ११ (अनुष्टुभ्)
एभिः समरूपहैशः मितपुनर्वितरणसमन्वितः ॥११॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
ring vnode remap replication membership पञ्चकम् ।
एभिः समरूपहैशः मितपुनर्वितरणसमन्वितः ॥११॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| ring | ring |
| vnode | vnode |
| remap | remap |
| replication | replication |
| membership | membership |
| पञ्चकम् | five-set |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| पञ्चकम् | ring vnode remap replica membership |
English sense
Five limbs: ring placement, vnodes for balance, minimal remap, replica placement and shared membership views.
Context / topic
Topic: checklist.
वृत्तमिति: ८-८-८-८।
श्लोकः १२ (अनुष्टुभ्)
मितं नर्तनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
इति समरूपहैशसारो मितपुनर्वितरणसमन्वितः ।
मितं नर्तनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| इति | thus |
| समरूपहैशसारः | consistent-hash essence |
| मितपुनर्वितरणम् | small redistribution |
| मितम् | measured |
| नर्तनम् | dancing/reshuffle |
| क्रियायोग्यम् | operable |
| तन्त्रधर्मः | system dharma |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| मितं नर्तनम् | measured reshuffle |
| तन्त्रधर्मः | platform dharma |
English sense
Closing: when the fleet changes size move as little truth as physics allows.
Context / topic
Topic: close.
उपसंहारन्यायः: कुञ्चिकां वृत्ते नय; नोडे जाते अल्पं चालय।
वृत्तमिति: ८-८-८-८।
श्लोकसूची / Verse index
१. Why CH
२. Ring
३. Vnodes
४. Rebalance
५. Replicas
६. Key choice
७. Hot keys
८. Membership
९. Cache moves
१०. Tenancy
११. Five limbs
१२. Close
सन्दर्भाः / References
- Prior: tenancy 2026-09-08; cache 2026-09-07; read replicas 2026-10-06; capacity 2026-07-15.
- Domain: consistent hashing for caches and shards.
- English minimizable; Sanskrit-first.
- Style: no em dash; no Oxford comma in English clauses.