alizainx/intelligence-systems-skills/consistent-hashing-sharding-rebalance
Claude Code and agent skill by alizainx/intelligence-systems-skills
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Partitioned distributed storage: Consistent Hashing with Bounded Loads, Rendezvous (HRW) hashing, virtual nodes, hot-key splitting, and zero-downtime migration.
Install
npx vskill@latest install alizainx/intelligence-systems-skills/consistent-hashing-sharding-rebalanceSKILL.md
The same SKILL.md was published earlier as alizainx/intelligence-systems-skills/consistent-hashing-sharding-rebalance.
consistent-hashing-sharding-rebalance (ISS-168)
1. First-Principles Invariant
- Karger/Mirrokni Bounded-Load Consistent-Hashing Law: Map each physical node to $V \ge 150$ virtual tokens on the $[0, 2^{64}-1]$ ring (or use Highest Random Weight Rendezvous hashing $\arg\max_{n} \text{hash}(key, n)$) and cap each node's load at $\lceil c \cdot (K / N) \rceil$ ($c = 1.25$), forwarding overflow keys to the next clockwise node with spare capacity so adding/removing a node moves only $O(K/N)$ keys while bounding peak imbalance.
2. Fast-Pass Low-Token Protocol (Web & Coding Agents)
- Detect power-law hot keys (
Zipfskew) via a heavy-hitter Count-Min Sketch / Top-K tracker and append a bounded random saltkey#0..S-1for read replication or split the hot range dynamically.
3. Zero-Bug & Zero-Vulnerability Guards
- Use a fast, deterministic, seed-stable 64-bit hash (
xxHash64,SipHash-2-4,MurmurHash3_x64_128) — never language-runtime randomized hashes (Python hash(),Go maphashacross restarts) for persistent shard routing. - Co-locate related tenant/entity rows on the same shard using a composite partition key
(tenant_id, entity_id)whereshard = hash(tenant_id)so single-tenant joins and transactions never cross shards. - Execute online shard splits and migrations via a 4-phase state machine:
SourceOnly -> DualWrite/BackfillCatchup -> ReadCutover -> SourceCleanup, gated by epoch numbers (ConfigEpoch) rejected by stale nodes. - Place the $R=3$ replicas of each shard across distinct failure domains (
rack,availability_zone,power_pdu) on the ring. - Verify key movement ratio ($\approx 1/N$) and max-to-mean load ratio ($\le 1.25$) across simulated node additions and removals.
4. Verification Gate
python3 -c 'import hashlib, bisect; ...'
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/consistent-hashing-sharding-rebalance/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alizainx/intelligence-systems-skills/consistent-hashing-sharding-rebalance)