---
slug: "Shard"
name: "Shard"
type: "Data Structures"
layer: "Infrastructure"
ref: "Shard#4d41"
sema_id: "sema:Shard#mh:SHA-256:4d41232416e3d414c714e0892e8559c2180899b4c21c25af29984372220f8704"
tags: ["Infrastructure","Data Structures"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.world/scapes/bootstrap.json
url: https://mindscape.world/bootstrap/Shard/
related: ["Conservation","Decompose","Resource","State","Vector","ExperienceSharding","FabricSharding"]
---

# Shard

Deterministic partitioning of state

Layer: Infrastructure · Category: Data Structures

## Mechanism

The fundamental primitive of distribution. It deterministically partitions a [Resource](https://mindscape.world/scapes/bootstrap/Resource.md), [State](https://mindscape.world/scapes/bootstrap/State.md), or [Vector](https://mindscape.world/scapes/bootstrap/Vector.md) into disjoint subsets (Shards) based on a Key (e.g., ID, Hash, Time). Unlike [Decompose](https://mindscape.world/scapes/bootstrap/Decompose.md), which splits complexity, Shard splits volume and load.

## Invariants

- [Conservation](https://mindscape.world/scapes/bootstrap/Conservation.md): Sum(Shards) == Total.
- Disjointness: Intersection(Shard_A, Shard_B) == Empty.
- Determinism: Key K always routes to Shard S.

## 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.

## Parameters

- `key_function` (Enum, {Hash, Range, Directory}): Partitioning strategy for distributing data across shards
- `partitions` (Integer, [2, 256]): Number of partitions to divide state into

## Data schema

```json
{
  "type": "object",
  "required": [
    "shard_id",
    "partition_index"
  ],
  "properties": {
    "shard_id": {
      "type": "string",
      "description": "Unique identifier for this shard"
    },
    "key": {
      "type": "string",
      "description": "The key used to route to this shard"
    },
    "partition_index": {
      "type": "integer",
      "description": "Which partition this shard belongs to"
    },
    "data": {
      "description": "The shard's contents"
    }
  }
}
```

## Builds on

- [Conservation](https://mindscape.world/scapes/bootstrap/Conservation.md) (Physics; References)
- [Decompose](https://mindscape.world/scapes/bootstrap/Decompose.md) (Mind; References)
- [Resource](https://mindscape.world/scapes/bootstrap/Resource.md) (Infrastructure; References)
- [State](https://mindscape.world/scapes/bootstrap/State.md) (Infrastructure; References)
- [Vector](https://mindscape.world/scapes/bootstrap/Vector.md) (Infrastructure; References)

## Used by

- [ExperienceSharding](https://mindscape.world/scapes/bootstrap/ExperienceSharding.md) (Mind; References)
- [FabricSharding](https://mindscape.world/scapes/bootstrap/FabricSharding.md) (Society; References)

## Identity

- Sema ID: `sema:Shard#mh:SHA-256:4d41232416e3d414c714e0892e8559c2180899b4c21c25af29984372220f8704`
- Ref: `Shard#4d41`
- Supersedes:
  - `sema:Shard#mh:SHA-256:328e51de920cace286a054e313321ff188e34a90d9e5dc8fca1eb2df24baded0`
  - `sema:Shard#mh:SHA-256:0c7f0ca5c9169b77bacc5825c072dcb9eef3ff7ceee76a4a2bdbc9ebedaceaa3`

## Links

- [Pattern page](https://mindscape.world/bootstrap/Shard/)
- [View in the interactive graph](https://mindscape.world/bootstrap/#Shard)
- [JSON](https://mindscape.world/scapes/bootstrap/Shard.json)
- [Index of all patterns](https://mindscape.world/scapes/bootstrap.json)
