Rating Cache
Non-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedback summaries and review lists.
Purpose & Ownership Boundary
Rating Cache is the non-authoritative FusionCache L1 + Redis L2 caching tier owned exclusively by 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 in the Reviews bounded context. Caching avoids repeated multi-step LLM summarization runs for identical books while keeping 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 (Azure Cosmos DB) as the sole source of truth for customer feedback.
Data Store Profile
| Property | Value |
|---|---|
| Bounded Context / Owner | Reviews — Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs |
| Engine / Technology | Redis + FusionCache (Azure Managed Redis in cloud; Redis container locally) |
| Store Type | Cache |
| Primary Writer(s) | 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 |
| Primary Reader(s) | 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 |
| Authoritative / Source of Truth | Derived Read Model (Ephemeral) |
| Data Classification | Internal |
| Retention / TTL Policy | Transient (6 hours for reviewed books; 1 minute when reviewCount == 0; 2-hour fail-safe window) |
Logical Data Layout & Key Patterns
| Key Pattern | Stored Data | TTL / Eviction | Invalidation / Update Trigger |
|---|---|---|---|
rating:summary:v1:{BookId} (reviewCount > 0) | JSON summary payload (summary, classification, averageRating, reviewCount, evidence, confidence) | 6 hours (L1 & L2) | Actively evicted on feedback deletions/reversions; refreshes by 6-hour TTL on additional reviews. |
rating:summary:v1:{BookId} (reviewCount == 0) | Empty-state summary payload (avoids LLM calls) | 1 minute (L1 & L2) | Actively evicted immediately when the first feedback is created, deleted, or reverted. |
Feedback list keys (tagged by BookId) | Paginated FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs list payloads | 30 minutes (Caching:Expiration default) | Actively evicted by tag on feedback creation, deletion, or reversion. |
| Integration idempotency keys | 24-hour Kafka message deduplication markers | 24 hours | Automatic TTL expiration after consumer processing. |
Consistency, Isolation & Security Guardrails
- Asymmetric summary staleness window: Deletions, reversions, and the first review on an unreviewed book evict
rating:summary:v1:{BookId}immediately; adding another review to an already-reviewed book refreshes on the6-hourTTL to bound LLM summarization cost. - Stampede & fail-safe protection: Distributed Redis locking ensures only one replica invokes 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 on a cache miss, and a 2-hour fail-safe window protects availability during transient downstream issues.
- Targeted invalidation: To force regeneration for a single book, delete only
rating:summary:v1:{BookId}.
Shared Redis Key-Prefix & Flush Isolation: Rating Cache shares the redis cluster with Basket DatabaseContainerv1.0.0Basket DatabaseAuthoritative Redis key-value store owned by the Shopping bounded context for customer-scoped pre-checkout shopping bask...Ownercommerce-fulfillment-teamDiagramOpen docs, 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, Order Cache and Distributed LocksContainerv1.0.0Order Cache and Distributed LocksRedis-backed coordination and caching slice owned by the Ordering bounded context for buyer-scoped creation locks, HTTP ...Ownercommerce-fulfillment-teamDiagramOpen docs, and Notification idempotency markers. Never flush the shared Redis instance globally—doing so clears active customer baskets, distributed checkout locks, and 24-hour Kafka idempotency markers across five services.
Operational & Resilience Notes
- Local vs. Cloud: Local development runs a persistent single-container Redis instance with
RedisInsight; cloud environments run Azure Managed Redis (
BalancedB0in Dev,BalancedB1with HA in Staging,BalancedB5with HA in Production). - Disposable state: Every cached summary and review list is fully rebuildable 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 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 on cache miss.
Architecture Visualizations
Loading graph...
Related Documentation
- 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 — Owning service REST endpoints, A2A gRPC server, and summary query.
- 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 — Authoritative Azure Cosmos DB store behind this cache.
- 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 — AI agent invoked on summary cache misses.
- ADR-004: Keep AI feedback summarization read-only and governedDecision Recordv1.0.0ADR-004: Keep AI feedback summarization read-only and governedRating generates feedback insights at read time with allow-listed read tools, PII redaction, and rate limits, without pe...Ownercatalog-experience-teamOpen docs — Decision governing read-only AI summarization.
- Backup, Restore & Disaster Recovery (DR)Custom DocBackup, Restore & Disaster Recovery (DR)Operator runbook for PostgreSQL point-in-time restore, Cosmos DB failover verification, Blob Storage recovery, and Qdran...Ownerplatform-engineering-teamOpen doc — Platform backup, restore, and disaster recovery runbook.