Design: Rating and Review System
Design covers backend services, database schema, and API flow for rating and review management. Frontend UI and payment integration are out of scope.
Functional Requirements
FR1: Users can submit ratings and text reviews for products or services.
FR2: Each product or service can have multiple reviews from different users.
FR3: Users can update or delete their own reviews.
FR4: Display average rating and total number of reviews per product.
FR5: Support pagination and sorting of reviews (e.g., newest, highest rating).
FR6: Prevent users from submitting multiple reviews for the same product.
FR7: Allow moderation to flag or remove inappropriate reviews.
Non-Functional Requirements
NFR1: Handle up to 1 million products and 10 million users.
NFR2: Support 100,000 concurrent review submissions and reads.
NFR3: API response time p99 under 300ms for reading reviews.
NFR4: System availability of 99.9% uptime.
NFR5: Data consistency for user reviews and ratings.