domain

Reviews & Ratings

The Reviews & Ratings domain owns customer feedback on products — how reviews are submitted, moderated, published and aggregated into the star ratings shown across the storefront.

DomainSupporting domainReview APIReviews Eventing

Overview

The Reviews & Ratings domain is responsible for everything to do with customer feedback on products: accepting reviews, moderating them for quality and abuse, publishing the approved ones, and aggregating them into the star ratings shown across the storefront.

Unlike most other domains in the catalog, Reviews & Ratings is modelled without systems — its services, data stores and flows hang directly off the domain.

What’s inside

ComponentTypeResponsibility
Review APIReview APIServicev1.0.0The public-facing API for product reviews. Accepts review submissions, serves published reviews, and is the entry point ...Publishesreview-submitted, review-flagged +1Subscribessubmit-review, flag-review +2Ownerreviews-platformMapRepoView docsServiceAccepts review submissions and serves product reviews.
Review Moderation WorkerReview Moderation WorkerServicev1.0.0Asynchronous worker that screens submitted reviews for spam, abuse and policy violations, then publishes or rejects them...Publishesreview-published, review-rejectedSubscribesreview-submitted, review-flaggedOwnerreviews-platformMapRepoView docsServiceScreens submitted reviews and publishes or rejects them.
Rating AggregatorRating AggregatorServicev1.0.0Keeps each product's aggregate star rating up to date as reviews are published, and serves it fast from a cache. Publishesrating-updatedSubscribesreview-publishedOwnerreviews-platformMapRepoView docsServiceKeeps each product’s aggregate rating in sync as reviews are published.
Review DatabaseReview DatabaseContainerv1.0.0PostgreSQL database that is the system of record for reviews and their moderation state.MapView docsData StoreSystem of record for reviews and their moderation state.
Rating CacheRating CacheContainerv1.0.0Redis cache that serves each product's aggregate star rating with low latency.MapView docsData StoreFast read store for aggregate product ratings.
ReviewReviewEntityv1.0.0A customer's review and rating of a product, including its moderation lifecycle.Ownerreviews-platformView docsEntityThe core review aggregate.

The diagram below shows the services, data stores and messages that make up this domain.

How it works

  1. A customer submits a review via the Review APIReview APIServicev1.0.0The public-facing API for product reviews. Accepts review submissions, serves published reviews, and is the entry point ...Publishesreview-submitted, review-flagged +1Subscribessubmit-review, flag-review +2Ownerreviews-platformMapRepoView docs, which stores it and publishes Review SubmittedReview SubmittedEventv1.0.0Published when a customer submits a review. The review is stored but not yet visible — it awaits moderation. Ownerreviews-platformSchemaMapView docs.
  2. The Review Moderation WorkerReview Moderation WorkerServicev1.0.0Asynchronous worker that screens submitted reviews for spam, abuse and policy violations, then publishes or rejects them...Publishesreview-published, review-rejectedSubscribesreview-submitted, review-flaggedOwnerreviews-platformMapRepoView docs screens the review and publishes either Review PublishedReview PublishedEventv1.0.0Published when a submitted review passes moderation and becomes visible on the storefront. Ownerreviews-platformSchemaMapView docs or Review RejectedReview RejectedEventv1.0.0Published when a submitted review fails moderation (spam, abuse or policy violation) and will not be shown. Ownerreviews-platformSchemaMapView docs.
  3. The Rating AggregatorRating AggregatorServicev1.0.0Keeps each product's aggregate star rating up to date as reviews are published, and serves it fast from a cache. Publishesrating-updatedSubscribesreview-publishedOwnerreviews-platformMapRepoView docs consumes Review PublishedReview PublishedEventv1.0.0Published when a submitted review passes moderation and becomes visible on the storefront. Ownerreviews-platformSchemaMapView docs and updates the product’s aggregate rating, publishing Rating UpdatedRating UpdatedEventv1.0.0Published when a product's aggregate rating changes as a result of a newly published review. Ownerreviews-platformSchemaMapView docs.

Once a review is live, customers can interact with it: Vote Review HelpfulVote Review HelpfulCommandv1.0.0Command issued by a customer to mark a published review as helpful (or remove their vote). Ownerreviews-platformSchemaMapView docs updates its helpful count (publishing Review Helpful VotedReview Helpful VotedEventv1.0.0Published when a review's helpful count changes as a result of a customer vote. Ownerreviews-platformSchemaMapView docs), and Flag ReviewFlag ReviewCommandv1.0.0Command issued by a customer or moderator to flag a published review for re-moderation. Ownerreviews-platformSchemaMapView docs reports it for re-moderation (publishing Review FlaggedReview FlaggedEventv1.0.0Published when a published review is flagged and needs to be screened again. Ownerreviews-platformSchemaMapView docs, which the Review Moderation WorkerReview Moderation WorkerServicev1.0.0Asynchronous worker that screens submitted reviews for spam, abuse and policy violations, then publishes or rejects them...Publishesreview-published, review-rejectedSubscribesreview-submitted, review-flaggedOwnerreviews-platformMapRepoView docs re-screens).