OptionalcoordinatorShard coordinator Durable Object
OptionaldebugEnable debug logging for development and troubleshooting
OptionaldisableDisable automatic migration detection and background migration (useful for testing)
OptionalhashWhether to hash shard mapping keys with SHA-256 for security and privacy. When enabled, primary keys are hashed before storing in KV, protecting sensitive data like emails from being visible in KV keys.
OptionalknownIn-memory TTL for known shard list cache.
OptionalkvExplicit KV store; when omitted, env.KV is detected and wrapped
OptionalmappingIn-memory TTL for primary key to shard mapping cache.
OptionalmaxMaximum database size in bytes. When set, shards that exceed this size are excluded from new allocations (existing mappings remain intact).
When omitted, size-based filtering is disabled to avoid extra sizing queries. This significantly reduces routing latency for write-heavy workloads.
OptionalmigrationConcurrency limit for migration mapping operations.
OptionalprimaryExplicit primary binding; defaults to env.DB when present
OptionalprimaryShard name to register the primary binding under (default: 'db-primary')
OptionalreservedBinding names to never treat as a shard
OptionalshardGeographic locations of each shard (required for location strategy)
OptionalshardBinding-name prefixes that identify shards (default: ['DB_', 'DB-', 'db-'])
OptionalsizeIn-memory TTL for shard size checks when maxDatabaseSize is enabled.
OptionalsqlDrizzle sql tag, forwarded to toProvider for Drizzle bindings
OptionalstrategyDefault shard allocation strategy (can be single strategy or mixed strategy object)
OptionaltargetTarget region for location-based sharding
Options for initializeFromEnv.
Since
1.2.4