अंशविभाजनधर्मः। सागायां (६ नव) बहुसेवा क्रमः। अत्र एकसत्यं बहुभण्डारेषु। shard key, locality, reshard। न केवलं replica; अंशधर्मः।
English (minimizable)
After sagas (6 Nov), this post covers sharding: key choice, range versus hash versus directory, single-shard locality, reshard planning, secondary indexes, routing maps, per-shard operations and contrasts with replicas and consistent hashing.
पूर्ण-शीर्षकम् / Full title
अंशविभाजनधर्मः: A Metrical Codification of Sharding (with English glosses)
English · overview and topics (minimizable)
What this post is about
Sharding partitions a dataset across multiple stores so storage and write throughput scale beyond one primary.
Topics covered
- Horizontal write scale
- Shard key fate
- Range hash directory
- Avoid cross-shard TX
- Reshard from day one
- Secondary index pain
- Locality-friendly keys
- Routing maps
- Per-shard ops
- Replica vs shard vs consistent hash
Sanskrit title
अंशविभाजनधर्मः = aṃśa-vibhājana-dharmaḥ “dharma of portion-splitting” (sharding).
English
Minimizable; Sanskrit-first.
परम्परा-सन्धिः / Series links
| पूर्वं / Prior | अत्र / Adds | न पुनः / Does not repeat |
|---|---|---|
| वाचनप्रतिलिपिः (६ अक्टो) | replicas | read scale |
| समरूपहैशः (१० अक्टो) | consistent hash | placement tool |
| अनुक्रमणिकाधर्मः (५ अक्टो) | indexes | local vs global |
| सागाधर्मः (६ नव) | cross-service | not same as shard TX |
| इदम् | shard keys ops | - |
ग्राह्य-त्याज्य-विवेकः / Keep and avoid
ग्राह्यम् / Keep
१. choose keys against skew: and locality
२. keep common TX single-shard: avoid scatter tax
३. plan reshard early: split/merge path
४. prefer local indexes: careful globals
५. central routing map: no app hardcode
६. alert per shard: not fleet mean only
७. entity/tenant keys: often beat pure random
त्याज्यम् / Avoid
- shard on always-hot single customer id without subsplit
- scatter-gather every user click
- no reshard story with fixed shard count forever
अध्याय-योजना / Chapter plan
| प्रकरणम् | विषयः | छन्दः | श्लोकाः |
|---|---|---|---|
| १ | मङ्गलं बीजं च / Opening | अनुष्टुभ् | २ |
| २ | मूलतत्त्वानि / Core | अनुष्टुभ् | २ |
| ३ | मुख्यविधिः / Method | उपजाति | १ |
| ४ | रक्षा · विधिः / Guards | अनुष्टुभ् | २ |
| ५ | विवेक · सीमा / Judgment | अनुष्टुभ् | २ |
| ६ | पूर्वसन्धिः / Series links | उपजाति | १ |
| ७ | उपसंहारः / Close | अनुष्टुभ् | २ |
पारिभाषिक-कोशः / Glossary
| Modern English | संस्कृतम् | Note |
|---|---|---|
| shard | अंशः / shard | |
| shard key | अंशकुञ्चिका | |
| resharding | पुनर्विभाजनम् | |
| hot key | तप्तकुञ्चिका | |
| range shard | परिसरअंशः | |
| hash shard | हैशअंशः | |
| directory map | निर्देशिकानक्शा | |
| scatter-gather | विकीर्णसंग्रहः | |
| routing layer | मार्गस्तरः | |
| cross-shard TX | अंशातरव्यवहारः |
श्लोकः १ (अनुष्टुभ्)
अंशविभाजनधर्मस्तस्माद् क्षैतिजवृद्धिः ॥१॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
एकभण्डारे यदि लेखनसीमा पूर्णता तदा अंशेषु विभज ।
अंशविभाजनधर्मस्तस्माद् क्षैतिजवृद्धिः ॥१॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| एकभण्डारे | in one store |
| लेखनसीमा | write limit |
| पूर्णता | full |
| अंशेषु | into shards |
| विभज | split |
| अंशविभाजनधर्मः | sharding dharma |
| क्षैतिजवृद्धिः | horizontal growth |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| अंशविभाजनधर्मः | sharding dharma |
| क्षैतिजवृद्धिः | horizontal scale |
English sense
Sharding splits data across many stores by a key so write and storage capacity grow horizontally beyond one primary.
Context / topic
Topic: why shard. Distinct from read replicas which scale reads more than writes.
वृत्तमिति: ८-८-८-८।
श्लोकः २ (अनुष्टुभ्)
hot key एकांश दहति ॥२॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
shard key chooses fate ।
hot key एकांश दहति ॥२॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| shard | shard |
| key | key |
| chooses | chooses |
| fate | fate |
| hot | hot |
| key | key |
| एकांश | one shard |
| दहति | burns |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| shard key | partition key |
| hot key | skew |
English sense
The shard key is an architecture decision. A hot key pins traffic to one shard and undoes the split.
Context / topic
Topic: key choice.
वृत्तमिति: ८-८-८-८।
श्लोकः ३ (अनुष्टुभ्)
एकविधिः न सर्वकर्म ॥३॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
range vs hash vs directory ।
एकविधिः न सर्वकर्म ॥३॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| range | range |
| hash | hash |
| directory | directory |
| एकविधिः | one method |
| न सर्वकर्म | not all jobs |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| range hash directory | placement styles |
| एकविधिः | one style |
English sense
Range suits ordered scans; hash spreads evenly; directory maps flexibility at metadata cost. Pick with access patterns.
Context / topic
Topic: placement.
वृत्तमिति: ८-८-८-८।
श्लोकः ४ (अनुष्टुभ्)
fanout query करः ॥४॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
cross-shard TX expensive or avoided ।
fanout query करः ॥४॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| cross-shard | cross-shard |
| TX | TX |
| expensive | expensive |
| avoided | avoided |
| fanout | fanout |
| query | query |
| करः | tax |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| cross-shard TX | distributed commit |
| fanout query | scatter gather |
English sense
Design so common transactions stay on one shard. Scatter-gather every request is a hidden monolith tax.
Context / topic
Topic: locality.
वृत्तमिति: ८-८-८-८।
श्लोकः ५ (उपजाति)
सीमा ।
forever fixed N
ऋणम् ॥५॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
reshard plan day one
सीमा ।
forever fixed N
ऋणम् ॥५॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| reshard | reshard |
| plan | plan |
| day | day |
| one | one |
| सीमा | bound |
| forever | forever |
| fixed | fixed |
| N | N |
| ऋणम् | debt |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| reshard plan | split/merge path |
| fixed N | no growth path |
English sense
Plan how to split and migrate shards before you need it. Fixed shard counts become hard ceilings.
Context / topic
Topic: resharding.
वृत्तमिति: एकादशाक्षराः पादाः।
श्लोकः ६ (अनुष्टुभ्)
local index + lookup ॥६॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
secondary indexes global hard ।
local index + lookup ॥६॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| secondary | secondary |
| indexes | indexes |
| global | global |
| hard | hard |
| local | local |
| index | index |
| lookup | lookup |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| global secondary | cross-shard index |
| local index | per shard |
English sense
Global secondary indexes reintroduce cross-shard pain. Prefer local indexes plus careful lookup services.
Context / topic
Topic: indexes.
वृत्तमिति: ८-८-८-८।
श्लोकः ७ (अनुष्टुभ्)
random UUID alone scatter join hell ॥७॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
tenant or entity id often good key ।
random UUID alone scatter join hell ॥७॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| tenant | tenant |
| entity | entity |
| id | id |
| good | good |
| key | key |
| random | random |
| UUID | UUID |
| scatter | scatter |
| join | join |
| hell | hell |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| entity id | natural locality |
| random UUID | no locality |
English sense
Keys that keep related rows together beat pure random spreads when transactions touch families of rows.
Context / topic
Topic: locality-friendly keys.
वृत्तमिति: ८-८-८-८।
श्लोकः ८ (अनुष्टुभ्)
app hardcode shard मिथ्या ॥८॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
routing layer knows map ।
app hardcode shard मिथ्या ॥८॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| routing | routing |
| layer | layer |
| knows | knows |
| map | map |
| app | app |
| hardcode | hardcode |
| shard | shard |
| मिथ्या | false |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| routing layer | central map |
| hardcode | brittle |
English sense
Keep shard maps in a routing service or proxy. Hardcoded shard lists in every app rot on reshard.
Context / topic
Topic: routing.
वृत्तमिति: ८-८-८-८।
श्लोकः ९ (अनुष्टुभ्)
global average माया ॥९॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
ops: per-shard lag disk p99 ।
global average माया ॥९॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| ops | ops |
| per-shard | per-shard |
| lag | lag |
| disk | disk |
| p99 | p99 |
| global | global |
| average | average |
| माया | illusion |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| per-shard ops | local SLOs |
| global average | hides hot shard |
English sense
Operate and alert per shard. Fleet averages hide the one shard on fire.
Context / topic
Topic: per-shard ops.
वृत्तमिति: ८-८-८-८।
श्लोकः १० (उपजाति)
अंश write scale ।
समरूपहैशः
कुञ्चिका पथ ॥१०॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
वाचनप्रतिलिपिः read scale
अंश write scale ।
समरूपहैशः
कुञ्चिका पथ ॥१०॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| वाचनप्रतिलिपिः | read replica |
| read | read |
| scale | scale |
| अंश | shard |
| write | write |
| scale | scale |
| समरूपहैशः | consistent hash |
| कुञ्चिका | key |
| पथ | path |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| वाचनप्रतिलिपिः | read replica |
| समरूपहैशः | consistent hash |
English sense
Replicas scale reads on one dataset; shards scale writes by split datasets; consistent hashing is one way to place keys on a ring.
Context / topic
Topic: series distinctions.
सन्धिः: प्रतिलिपि पठन; अंश लेखनविभाग; हैश स्थानमानचित्र।
वृत्तमिति: एकादशाक्षराः पादाः।
श्लोकः ११ (अनुष्टुभ्)
एभिरंशविभाजनधर्मः क्षैतिजवृद्धिसमन्वितः ॥११॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
key locality reshard index route ops पञ्चकम् ।
एभिरंशविभाजनधर्मः क्षैतिजवृद्धिसमन्वितः ॥११॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| key | key |
| locality | locality |
| reshard | reshard |
| index | index |
| route | route |
| ops | ops |
| पञ्चकम् | five-set |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| पञ्चकम् | key locality reshard index route ops |
English sense
Five limbs: careful keys, single-shard locality for common TX, reshard plan, index strategy with routing map and per-shard ops.
Context / topic
Topic: checklist.
वृत्तमिति: ८-८-८-८।
श्लोकः १२ (अनुष्टुभ्)
मितं विभाजनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥
पदच्छेदः · Word-for-word · English (minimizable)
पदच्छेदः
इत्यंशविभाजनधर्मसारः क्षैतिजवृद्धिसमन्वितः ।
मितं विभाजनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥
Word-for-word
| संस्कृतपदम् | Word-for-word English |
|---|---|
| इति | thus |
| अंशविभाजनधर्मसारः | sharding essence |
| क्षैतिजवृद्धिः | horizontal growth |
| मितम् | measured |
| विभाजनम् | partition |
| क्रियायोग्यम् | operable |
| तन्त्रधर्मः | system dharma |
Gloss table
| पदम् | अर्थः / sense |
|---|---|
| मितं विभाजनम् | measured split |
| तन्त्रधर्मः | platform dharma |
English sense
Closing: split on a wise key, keep common work local and watch every shard as its own patient.
Context / topic
Topic: close.
उपसंहारन्यायः: कुञ्चिकां चिन्तय; एकांशे व्यवहारं रक्ष; प्रत्येकं पश्य।
वृत्तमिति: ८-८-८-८।
श्लोकसूची / Verse index
१. Why shard
२. Keys
३. Placement
४. Locality
५. Reshard
६. Indexes
७. Key types
८. Routing
९. Per-shard ops
१०. Series
११. Five limbs
१२. Close
सन्दर्भाः / References
- Prior: replicas 2026-10-06; consistent hash 2026-10-10; saga 2026-11-06.
- Domain: data sharding.
- English minimizable; Sanskrit-first.
- Style: no em dash; no Oxford comma in English clauses.