Feedback lifecycle
How customers submit feedback and how Reviews publishes rating changes to Catalog.
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
Create feedback
A caller submits a
bookId, reviewer name, integer rating (0–5), and optional comment toPOST /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, returns200 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>.NoteReturning
200 OKconfirms 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.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.
Delete feedback (moderation)
Authorized administrators remove a review via
DELETE /api/v1/feedbacks/{id}(missing IDs return404 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.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
bookIdthat 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.
| Decision | Benefits | Costs and limits |
|---|---|---|
| Cosmos DB for Reviews vs. PostgreSQL for Catalog | Partitioning by /bookId gives fast per-book queries and isolates write scaling | Two database technologies to operate; cross-domain consistency is eventual |
| Post-commit Kafka projection with compensation | Keeps review submissions fast and resilient even if Catalog is temporarily unavailable | Rating summaries briefly lag behind Reviews; invalid submissions clean up asynchronously |
| Idempotent consumers | Tolerates at-least-once Kafka redelivery without skewing Catalog totals | Requires healthy Redis alongside Kafka consumers |
| Read-only AI summarization (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) | Provides governed, PII-filtered insights without risking corruption of customer ratings | Summary generation incurs live LLM and MCP lookup latency |
Rejected alternatives:
- Synchronous gRPC check against Catalog before saving feedback: A book can still be deleted between check and projection, and synchronous validation couples Reviews write availability to Catalog uptime.
- Storing feedback in PostgreSQL inside Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs: Breaks bounded-context isolation between Reviews and Catalog.
Related documentation
- Customer Feedback Publication and ProjectionFlowv1.0.0Customer Feedback Publication and ProjectionRating API persists customer feedback in Cosmos DB and publishes an integration event; Catalog API updates the derived b...Ownercatalog-experience-teamView flowOpen docs — End-to-end feedback publication, projection, and compensation flow.
- ADR-002: Publish feedback events for Catalog's rating projectionDecision Recordv1.0.0ADR-002: Publish feedback events for Catalog's rating projectionRating publishes committed feedback-created and feedback-deleted events so Catalog can maintain its own eventually consi...Ownercatalog-experience-teamOpen docs — Decision record for asynchronous feedback projection.
- ADR-003: Compensate feedback rejected by CatalogDecision Recordv1.0.0ADR-003: Compensate feedback rejected by CatalogRating removes feedback when Catalog reports that a feedback-created event referenced a missing book, and treats repeate...Ownercatalog-experience-teamOpen docs — Compensation when Catalog rejects a missing book ID.
- arc42 Architecture OverviewCustom Docarc42 Architecture OverviewEntry point to BookWorm's architecture, key boundaries, and supporting documentation.Ownerarchitecture-enabling-teamOpen doc — System-wide bounded contexts and data stores.