Design a Review and Rating System
Design the review and rating system for a large marketplace. Verified customers can rate a purchased product, optionally write a review, and later edit or delete it. Product pages must show the aggregate score, rating distribution, and review lists under several sort orders. Moderation may hide or remove content, and every state change must update customer-visible aggregates correctly. Define the APIs, data model, read and write paths, consistency boundaries, scaling strategy, and failure recovery.