Design: Cross-shard Query System
Design focuses on the architecture and flow for executing cross-shard queries efficiently and reliably. Does not cover shard key design or shard rebalancing.
Functional Requirements
FR1: Support queries that need to fetch and combine data from multiple database shards.
FR2: Ensure query results are consistent and accurate across shards.
FR3: Minimize query latency to keep response times under 500ms for 95% of queries.
FR4: Handle up to 10,000 concurrent cross-shard queries.
FR5: Support both read-only and read-write queries spanning multiple shards.
Non-Functional Requirements
NFR1: Data is horizontally partitioned (sharded) across multiple database instances.
NFR2: Each shard holds a subset of the total data with no overlap.
NFR3: System availability target is 99.9% uptime.
NFR4: Network latency between shards can vary up to 50ms.
NFR5: Queries must not overload any single shard or network link.