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

Read the architecture guide →

Rating summary mismatch

Investigate when a book's average rating or review count disagrees with Reviews.

Runbook

Trigger / Symptom & Blast Radius

A book’s average_rating or total_reviews in 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 disagrees 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, or 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 appears on <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 owns authoritative 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, 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 maintains only a derived summary 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.

Danger

Never invent or hand-edit average_rating or total_reviews 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 without deriving the exact aggregate 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. Replaying already-applied rating events after the 24-hour idempotency window expires will double-count ratings.

Pre-Flight Check

Compare Catalog’s derived summary 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 against the authoritative aggregate 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 (ratingdb / feedbacks):

SELECT id, name, average_rating, total_reviews, is_deleted FROM books WHERE id = '<BOOK_ID>';
SELECT COUNT(1) AS total_reviews, AVG(c.rating) AS average_rating FROM c WHERE c.bookId = '<BOOK_ID>';

Quick Recovery Procedure

  1. Check for missing-book compensation events

    Inspect <code>bookworm.{env}.catalog.book-update-rating-failed</code> for 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. If present, 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 could not find <BOOK_ID> and emitted the compensation event so 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 deletes the orphaned feedback document.

  2. Inspect Kafka consumer lag and dead-letter queues

    Check consumer lag 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 logs across <code>bookworm.{env}.rating.feedback-create</code>, <code>bookworm.{env}.rating.feedback-delete</code>, and <code>bookworm.{env}.catalog.dead-letter-queue</code>:

    Terminal window
    az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 150

  3. Recover without double-counting

    Unprocessed DLQ messages: Fix the underlying database or handler fault first, then replay only unapplied messages from <code>bookworm.{env}.catalog.dead-letter-queue</code>.

    Confirmed multi-event delta drift: Execute an approved reconciliation setting average_rating and total_reviews directly from the authoritative 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 aggregate, then evict book:<BOOK_ID> from Catalog CacheContainerv1.0.0Catalog CacheNon-authoritative FusionCache and Redis caching layer owned by the Catalog bounded context for fast book detail lookups ...Ownercatalog-experience-teamDiagramOpen docs.

Verification

Query 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 and confirm averageRating and totalReviews match 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:

Terminal window
curl -sS "https://<GATEWAY_HOST>/catalog/api/v1/books/<BOOK_ID>" | jq '{id, averageRating, totalReviews}'

Expected output:

{
"id": "<BOOK_ID>",
"averageRating": 4.5,
"totalReviews": 12
}

Rollback / Escalation

  • Rollback: Re-run the authoritative reconciliation query 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 evict book:<BOOK_ID> in Catalog CacheContainerv1.0.0Catalog CacheNon-authoritative FusionCache and Redis caching layer owned by the Catalog bounded context for fast book detail lookups ...Ownercatalog-experience-teamDiagramOpen docs if a manual correction used wrong values.
  • Escalation: Escalate persistent projection or compensation failures to Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs with <BOOK_ID> and event IDs.