{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "Shard",
 "ref": "Shard#4d41",
 "hash": "sema:Shard#mh:SHA-256:4d41232416e3d414c714e0892e8559c2180899b4c21c25af29984372220f8704",
 "stub": "4d41",
 "layer": "Infrastructure",
 "type": "Data Structures",
 "summary": "Deterministic partitioning of state",
 "mechanism": "The fundamental primitive of distribution. It deterministically partitions a Resource#0e5e, State#4f25, or Vector#4268 into disjoint subsets (Shards) based on a Key (e.g., ID, Hash, Time). Unlike Decompose#6994, which splits complexity, Shard splits volume and load.",
 "invariants": [
  "Conservation#0b32: Sum(Shards) == Total.",
  "Disjointness: Intersection(Shard_A, Shard_B) == Empty.",
  "Determinism: Key K always routes to Shard S."
 ],
 "parameters": [
  {
   "name": "key_function",
   "type": "Enum",
   "range": "{Hash, Range, Directory}",
   "description": "Partitioning strategy for distributing data across shards"
  },
  {
   "name": "partitions",
   "type": "Integer",
   "range": "[2, 256]",
   "description": "Number of partitions to divide state into"
  }
 ],
 "signature": [],
 "preconditions": [],
 "postconditions": [],
 "failure_modes": [
  "Hot shard: skewed keys concentrate load on one partition — a consequence of Determinism.",
  "Rebinding on resize: changing the partition count invalidates every routing decision taken under the old count.",
  "Cross-shard operation: spanning shards requires coordination, because Disjointness guarantees no shard holds another's data."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "Shard",
 "builds_on": [
  {
   "alias": "conservation",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Conservation",
   "ref": "Conservation#0b32",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Conservation"
  },
  {
   "alias": "vector",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Vector",
   "ref": "Vector#4268",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Vector"
  },
  {
   "alias": "resource",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Resource",
   "ref": "Resource#0e5e",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Resource"
  },
  {
   "alias": "state",
   "relation": "references",
   "library": "bootstrap",
   "slug": "State",
   "ref": "State#4f25",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/State"
  },
  {
   "alias": "decompose",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Decompose",
   "ref": "Decompose#6994",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Decompose"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "ExperienceSharding",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ExperienceSharding"
  },
  {
   "slug": "FabricSharding",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/FabricSharding"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/Shard",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/Shard.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
