Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Feedback lifecycle

How customers submit feedback and how Reviews publishes rating changes to Catalog.

Guide

Audience & Outcome: This guide is for backend engineers, moderators, and integrators working with Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs and Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs. You will learn how customer reviews are persisted, summarized by AI, projected asynchronously to Catalog, and compensated when a target book is missing.

BookWorm separates customer review storage from product catalog browsing across two independent bounded contexts: Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs owns individual FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs documents in Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs (partitioned by /bookId), while Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs owns BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs records in Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs and maintains only a derived rating summary (average_rating and total_reviews).

Context and motivation

Individual customer reviews and catalog product listings have different access patterns, scaling profiles, and consistency requirements:

  • Reviews stores append-heavy, book-partitioned documents and supports paginated browsing and AI-generated review summaries.
  • Catalog serves high-volume browsing and search queries that only need an aggregate average score and review count per book.

Sharing a single database between Reviews and Catalog—or blocking review writes on synchronous Catalog updates—would couple deployment lifecycles and turn temporary Catalog slowdowns into customer review outages.

How it works

The visual below traces the normal creation and deletion projection path from Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs to Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs alongside the compensating delete path when a book no longer exists.

Loading graph...

Four lifecycle stages

  1. Create feedback

    A caller submits a bookId, reviewer name, integer rating (0–5), and optional comment to POST /api/v1/feedbacks. Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs persists the FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs document in Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs, returns 200 OK, and publishes Feedback createdEventv1.0.0Feedback createdIndicates that a customer feedback rating was created for a book. Rating API publishes this event so Catalog can update ...Ownercatalog-experience-teamSchemaDiagramOpen docs to <code>bookworm.{env}.rating.feedback-create</code>.

    Note

    Returning 200 OK confirms review persistence in Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs—not that Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs has finished updating its summary.

  2. Read feedback and generate AI summaries

    Paginated reviews for a book are cached for 10 minutes in Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs. Authenticated callers can request an AI summary, which runs Rating AgentAgentv1.0.0Rating AgentRead-only review intelligence specialist that summarizes customer feedback over A2A gRPC and map-reduce workflows while ...PublishesAnalyzeText, AnonymizeTextOwnercatalog-experience-teamDiagramRepositoryOpen docs with Presidio APIServicev1.0.0Presidio APIExternal HTTP sidecar API for detecting PII in text and anonymizing detected entities in the Chat and Rating AI agent pi...SubscribesAnalyzeText, AnonymizeText +3APIsOpenAPIOwnerplatform-engineering-teamDiagramOpen docs PII protection. The agent reads live book context through MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs and raw reviews, returning a read-only derived summary that never mutates Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs or Catalog.

  3. Delete feedback (moderation)

    Authorized administrators remove a review via DELETE /api/v1/feedbacks/{id} (missing IDs return 404 Not Found). Deleting an existing record removes the document from Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs and publishes Feedback deletedEventv1.0.0Feedback deletedIndicates that a customer feedback rating was deleted for a book. Rating API publishes this event so Catalog can remove ...Ownercatalog-experience-teamSchemaDiagramOpen docs to <code>bookworm.{env}.rating.feedback-delete</code> so Catalog decrements its projection asynchronously.

  4. Asynchronous projection and compensation

    Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs consumes create and delete events with a 24-hour idempotency guard so at-least-once retries cannot double-count ratings. If a Feedback createdEventv1.0.0Feedback createdIndicates that a customer feedback rating was created for a book. Rating API publishes this event so Catalog can update ...Ownercatalog-experience-teamSchemaDiagramOpen docs arrives for a bookId that does not exist in Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, Catalog publishes Book rating update failedEventv1.0.0Book rating update failedIndicates that Catalog could not apply a feedback-created event because the referenced book was not found. Ownercatalog-experience-teamSchemaDiagramOpen docs to <code>bookworm.{env}.catalog.book-update-rating-failed</code>. Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs‘s compensation handler invalidates Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs and deletes the orphaned document without emitting a delete event.