@earth-app/collegedb
    Preparing search index...

    Interface ShardCoordinatorState

    Durable Object state for shard coordination

    interface ShardCoordinatorState {
        knownShards: string[];
        roundRobinIndex: number;
        sequences?: Record<string, number>;
        shardLocations?: Record<string, ShardLocation>;
        shardStats: Record<string, ShardStats>;
        strategy: ShardingStrategy | MixedShardingStrategy;
        targetRegion?: D1Region;
    }
    Index
    knownShards: string[]

    List of known D1 bindings

    roundRobinIndex: number

    Round-robin counter for allocation

    sequences?: Record<string, number>

    Monotonic named sequence counters used for cross-shard id generation. Keyed by sequence name (typically a table name).

    1.2.4

    shardLocations?: Record<string, ShardLocation>

    Geographic locations of each shard

    shardStats: Record<string, ShardStats>

    Statistics for each shard

    Current allocation strategy round-robin - distributes keys evenly across shards random - selects a random shard for each key hash - uses a hash function to determine shard based on primary key (default) location - selects shards based on geographic proximity to reduce latency Can also be a mixed strategy object with separate read/write strategies

    targetRegion?: D1Region

    Target region for location-based allocation