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

    Interface ShardCoordinatorState

    Durable Object state for shard coordination

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

    Properties

    knownShards: string[]

    List of known D1 bindings

    roundRobinIndex: number

    Round-robin counter for allocation

    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