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

Read the architecture guide →

Authoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publishers, and vector-indexing coordination.

Databaseazure-postgresql-flexible-serverResidency: eastasiaRetention: indefiniteAccess Mode: readWriteDatabase

Purpose & Ownership Boundary

Catalog Database (catalogdb) is the authoritative relational system of record for the Catalog bounded context, owned by 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. PostgreSQL was chosen for strict relational integrity across product taxonomy, transactional outbox messaging, and trigger-driven change capture for asynchronous search indexing by Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs.

Data Store Profile

PropertyValue
Bounded Context / OwnerCatalog — Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs
Engine / TechnologyPostgreSQL 18 (Azure Database for PostgreSQL Flexible Server)
Store TypeDatabase
Primary Writer(s)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 (domain writes), Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs (queue acknowledgment only)
Primary Reader(s)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, Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs
Authoritative / Source of TruthYes
Data ClassificationInternal
Retention / TTL PolicyIndefinite (soft-delete flag on books; transactional outbox pruned after dispatch)

Logical Data Layout & Key Patterns

All identifiers use snake_case, primary keys default to time-ordered uuidv7(), and audit timestamps (created_at, last_modified_at) are database-generated.

Table / SchemaOwned EntityPartition / Primary KeyPurpose & Concurrency
booksBookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docsid (uuidv7())Canonical book catalog, pricing, availability status, soft-delete flag (is_deleted), blob URN (image), and derived rating projection (average_rating, total_reviews); optimistic concurrency via row_version.
authorsAuthorEntityv1.0.0AuthorRepresents a credited author of one or more books in the product catalog, enforcing display-name validity and referentia...Ownercatalog-experience-teamOpen docsid (uuidv7())Author directory; deletion restricted while referenced in book_authors.
categoriesCategoryEntityv1.0.0CategorySingle-level taxonomy classification grouping books by subject or genre within the product catalog.Ownercatalog-experience-teamOpen docsid (uuidv7())Product category taxonomy with unique name; deleting a category sets books.category_id to NULL.
publishersPublisherEntityv1.0.0PublisherRepresents a publishing house or imprint associated with books in the product catalog.Ownercatalog-experience-teamOpen docsid (uuidv7())Publisher directory with unique name; deleting a publisher sets books.publisher_id to NULL.
book_authorsBookEntityv1.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(book_id, author_id)Many-to-many join table; deleting a book cascades to its author links.
pending_vector_updates—book_id (uuid)Coalescing change-capture queue with revision UUID and updated_at; repeated edits update the row in place.
wolverine schema—Envelope IDTransactional outbox and inbox tables sharing the domain write transaction; partitions Kafka events by BookId and FeedbackId.

Consistency, Isolation & Security Guardrails

  • Transactional outbox: Domain writes and outbound integration events commit in a single PostgreSQL transaction via the wolverine outbox schema.
  • Trigger-driven search sync: Five database triggers (books, book_authors, authors, categories, publishers) enqueue affected book_id rows into pending_vector_updates. Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs acquires PostgreSQL advisory lock 740031001, processes up to 200 rows per batch, and deletes only rows whose book_id and revision still match.
  • Soft-delete & URN invariants: Books use is_deleted soft deletion rather than physical row removal. The books.image column stores permanent blob URNs pointing to 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, never raw bytes or expiring SAS URLs.
  • Derived rating projections: average_rating and total_reviews on books are eventually consistent projections updated from 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 and 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; 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 remains authoritative for individual reviews.
Warning

Database-per-Service Isolation: Only 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 may mutate catalog domain tables, 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 is restricted to reading catalog state and acknowledging pending_vector_updates. External services (such as 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, or 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) must never connect to catalogdb directly—all cross-context reads flow through 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 HTTP/gRPC contracts or Kafka events.

Operational & Resilience Notes

Architecture Visualizations & Schema

Loading graph...