Design: CQRS-based System
Design the architecture separating command and query responsibilities including data flow, components, and database schema. Out of scope: detailed UI design and specific technology vendor choices.
Functional Requirements
FR1: Separate the system into command (write) and query (read) parts
FR2: Ensure commands update data consistently
FR3: Allow queries to be optimized for fast reads
FR4: Support eventual consistency between command and query data stores
FR5: Handle 10,000 concurrent users with 70% read and 30% write operations
FR6: API response time for queries should be under 150ms at p99
FR7: System availability should be 99.9%
Non-Functional Requirements
NFR1: Data consistency between command and query sides can be eventual, not immediate
NFR2: Write operations must be strongly consistent
NFR3: Read operations should not block writes
NFR4: System must scale horizontally
NFR5: Latency for command processing should be under 300ms
