Consistency and data ownership
Authoritative stores, derived projections, transactional boundaries, and propagation guarantees in Catalog.
Purpose & Scope
This document defines data ownership, transactional boundaries, cache invalidation, and eventual consistency guarantees for the CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs subdomain, governing 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 Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs. Use it to reason about which stores are authoritative systems of record versus replayable projections before modifying write paths, search indexing, or cross-domain rating handlers.
Visual Reference
The visual below illustrates how catalog mutations, scheduled vector indexing, and cross-domain rating events propagate across authoritative and derived stores.
Loading graph...
Catalog Write, Cache Invalidation, and Index Propagation Pipeline
Core Invariants & Design Rules
- Authoritative vs. derived separation: Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs (PostgreSQL) is the sole system of record for BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs, AuthorEntityv1.0.0AuthorRepresents a credited author of one or more books in the product catalog, enforcing display-name validity and referentia...Ownercatalog-experience-teamOpen docs, CategoryEntityv1.0.0CategorySingle-level taxonomy classification grouping books by subject or genre within the product catalog.Ownercatalog-experience-teamOpen docs, and PublisherEntityv1.0.0PublisherRepresents a publishing house or imprint associated with books in the product catalog.Ownercatalog-experience-teamOpen docs state, while Catalog Blob StorageContainerv1.0.0Catalog Blob StorageAuthoritative Azure Blob Storage container owned by the Catalog bounded context for binary book cover images and media a...Ownercatalog-experience-teamDiagramOpen docs owns binary cover artwork referenced by URN. Both 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 (Redis) and Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs (Qdrant) are disposable projections that can be cleared or rebuilt without data loss.
- Transactional index queuing: Mutations to 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 atomically upsert affected book identifiers into an internal pending-update queue via database triggers, coalescing repeated edits under a fresh
revisionUUID and timestamp. - Advisory-locked batch ingestion: Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and
synchronizes semantic search vectors in Qdrant.
SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs processes queued updates under PostgreSQL advisory lock
740031001in batches of up to200items, acknowledging only rows whose(book_id, revision)pair still matches the batch snapshot so concurrent writes are never lost. - Soft-delete propagation: Deleting a BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs sets
is_deleted = true, triggers the pending-update queue, and causes Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs to remove the corresponding UUID from Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs. - Taxonomy deletion rules: Deleting a CategoryEntityv1.0.0CategorySingle-level taxonomy classification grouping books by subject or genre within the product catalog.Ownercatalog-experience-teamOpen docs or PublisherEntityv1.0.0PublisherRepresents a publishing house or imprint associated with books in the product catalog.Ownercatalog-experience-teamOpen docs preserves associated books by clearing the reference, whereas deleting an AuthorEntityv1.0.0AuthorRepresents a credited author of one or more books in the product catalog, enforcing display-name validity and referentia...Ownercatalog-experience-teamOpen docs with active books is rejected.
- Discount price invariant: A book’s discount price must always remain non-negative and less than or equal to its original price.
Never use derived stores for purchase or checkout decisions. Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs and Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs must resolve prices and book existence exclusively through gRPC queries backed by Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs—never from Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs or stale client caches.
Boundaries & Guarantees
| Concern | Strategy & Guarantee | Failure / Edge-Case Behavior | Related Resources |
|---|---|---|---|
| Persistence | catalog-database provides ACID transactions for catalog entities, pending vector updates, and Wolverine outbox/inbox tables; catalog-blob stores cover images with expiring read-only SAS URLs (1h default). | Uncommitted writes never enqueue vector updates or outbox messages; missing blobs surface as unavailable cover URLs without corrupting book records. | catalog-database, catalog-blob, adr-001-postgresql-system-of-record, adr-005-blob-storage-for-book-images |
| Caching | catalog-cache uses FusionCache L1/L2 with a Redis backplane and 2h fail-safe; book detail (book:{id}) and summary (book:summary:{id}) keys expire in 30m and are actively invalidated on write; dashboard metrics (catalog:dashboard:v1) expire every 15s. | List (books:list) and search (books:search) keys are tag-invalidated; if Redis is unavailable, FusionCache falls back to L1/fail-safe or direct database reads. | catalog-cache, adr-004-fusioncache-redis-for-catalog-reads |
| Messaging | scheduler-service triggers catalog-ingestion every 5m UTC via ProcessVectorBatchIntegrationEvent; catalog-api consumes FeedbackCreatedIntegrationEvent and FeedbackDeletedIntegrationEvent to project average_rating and total_reviews. | Missing books on feedback creation emit BookUpdatedRatingFailedIntegrationEvent for compensation; missing books on feedback deletion complete as a no-op; exhausted retries route to <code>bookworm.{env}.catalog.dead-letter-queue</code>. | ProcessVectorBatchIntegrationEvent, FeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEvent, BookUpdatedRatingFailedIntegrationEvent, <code>bookworm.{env}.catalog.dead-letter-queue</code> |
| Concurrency | catalog-ingestion uses PostgreSQL advisory lock 740031001 and (book_id, revision) optimistic matching; inbound rating events use a 24h Redis integration-event idempotency guard; Qdrant upserts are idempotent by book UUID. | Duplicate rating events within 24h are ignored; concurrent book edits during an ingestion batch advance revision and are automatically picked up on the next run. | product-ingestion, adr-003-database-queue-for-vector-indexing, adr-006-reviews-rating-projection-on-book |
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 is the authoritative owner of individual FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs records.
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 derived average_rating and total_reviews columns on
BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs. If 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 nonexistent or
deleted book, 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 emits 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 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 can revert the orphaned feedback.
Because Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs is a pure projection of Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, any schema or embedding-model change can be recovered by re-enqueuing all active books into the pending-update queue and letting Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs overwrite Qdrant points deterministically by UUID.
Safe Change & Verification Checklist
- Keep searchable attributes synchronized between PostgreSQL pending-update triggers and Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs embedding text generation, and plan a full vector re-index when indexed fields change.
- Invalidate
book:{id},book:summary:{id}, and affectedbooks:list/books:searchtags on every book mutation, and bump versioned cache key prefixes (v1) if cached DTO shapes change. - Preserve
snake_casenaming for all Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs schema migrations and keep all Qdrant upserts idempotent by book UUID. - Verify downstream gRPC compatibility with Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, and 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 confirm Pact contract tests pass for all rating and scheduler events.
Related Resources
- 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 — Authoritative catalog REST/gRPC API and rating projection consumer
- Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs — Scheduled vector indexing worker
- Product IngestionFlowv1.0.0Product IngestionCatalog API persists product changes in PostgreSQL; Scheduler triggers Catalog Ingestion over Kafka every five minutes t...Ownercatalog-experience-teamView flowOpen docs — End-to-end vector indexing and advisory-lock workflow
- ADR-001: Use PostgreSQL as the Catalog system of recordDecision Recordv1.0.0ADR-001: Use PostgreSQL as the Catalog system of recordCatalog Database (PostgreSQL) is the single authoritative store for books, authors, categories, and publishers; cache an...Ownercatalog-experience-teamOpen docs, ADR-002: Use Qdrant hybrid vector and keyword search for product discoveryDecision Recordv1.0.0ADR-002: Use Qdrant hybrid vector and keyword search for product discoveryText search finds candidate book IDs in Qdrant using embeddings plus keyword matching, then loads canonical records from...Ownercatalog-experience-teamOpen docs, ADR-003: Maintain the vector index asynchronously through a database-backed queueDecision Recordv1.0.0ADR-003: Maintain the vector index asynchronously through a database-backed queueDatabase triggers enqueue changed books, and Catalog Ingestion drains the queue in batches to update Qdrant, decoupling ...Ownercatalog-experience-teamOpen docs, ADR-004: Use FusionCache with Redis for selected catalog readsDecision Recordv1.0.0ADR-004: Use FusionCache with Redis for selected catalog readsHot book lookups and the dashboard summary are cached through a FusionCache L1 in-process plus Redis distributed layer, ...Ownercatalog-experience-teamOpen docs, ADR-006: Keep only a derived rating summary on Catalog booksDecision Recordv1.0.0ADR-006: Keep only a derived rating summary on Catalog booksReviews owns individual feedback; Catalog stores just an average rating and review count per book, updated from feedback...Ownercatalog-experience-teamOpen docs
- API and contracts indexCustom DocAPI and contracts indexConsolidated index of BookWorm HTTP v1, gRPC, AG-UI, MCP, A2A, and Kafka/Wolverine contracts grouped by service with aut...Ownerplatform-engineering-teamOpen doc — Consolidated HTTP, gRPC, and Kafka contracts