Stateful Data, AI & Messaging Infrastructure
Technical reference for Azure-managed databases, caches, storage, Durable Task Scheduler, Microsoft Foundry, and external dependencies.
Each BookWorm bounded context owns its authoritative persistence, isolated behind service APIs and authenticated via Microsoft Entra ID RBAC. This reference documents the Azure-managed data and AI stores alongside external messaging, vector search, and email dependencies.
Data, AI, and Messaging Topology
Loading graph...
Component & Responsibility
| Component | Role | Protocol / Interface | Persistence / State | Notes |
|---|---|---|---|---|
| PostgreSQL Flexible Server | Relational & event-store persistence | PostgreSQL 16 (Entra ID auth) | Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs, Scheduler DatabaseContainerv1.0.0Scheduler DatabaseAuthoritative PostgreSQL database owned by the Platform bounded context for Quartz.NET job definitions, cluster locks, e...Ownerplatform-engineering-teamDiagramOpen docs | Password auth disabled; PgBouncer in Staging/Prod |
| Azure Managed Redis | Distributed cache, basket state & idempotency | TLS port 10000 (Entra ID auth) | 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, 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 | Used 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, 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, 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, Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs |
| Azure Cosmos DB | Customer feedback document store | EF Core Cosmos (Session consistency) | 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 book ID) | Owned 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 only |
| Azure Storage | Blob assets & Azure Functions host state | HTTPS (TLS 1.2+, Managed Identity) | 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, Chat Session Blob StorageContainerv1.0.0Chat Session Blob StorageAuthoritative Azure Blob Storage container owned by the Conversational bounded context for durable AG-UI multi-turn chat...Ownerai-capabilities-teamDiagramOpen docs, Functions host | Public blob access disabled |
| Durable Task Scheduler | Durable orchestration state & timers | Managed Identity auth | Order workflow task hub | Owned by Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs only |
| Microsoft Foundry | Managed LLM chat, routing & embedding inference | HTTPS (Cognitive Services User RBAC) | Stateless inference (S0 + App Insights) | Used 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, Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs, Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs, 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 |
| Kafka Broker | Asynchronous event & command transport | Kafka | Topic logs & dead-letter queues | Wolverine transport with CloudEvents JSON |
| Qdrant Cloud | Derived semantic vector search index | gRPC / HTTP | 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 | Read 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; written 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 |
| SMTP Relay | External transactional email delivery | SMTP port 587 (SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered
order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs) | Stateless relay | Used by Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs; Mailpit in local run mode |
Configuration & Operational Defaults
Data Ownership per Service
| Service | Primary store | Cache / idempotency | Messaging | Other |
|---|---|---|---|---|
| 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 DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-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 | Kafka + PostgreSQL outbox/inbox | 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, 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, Foundry |
| Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs | Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs (read) | — | Kafka trigger + PostgreSQL outbox | 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 (write), Foundry, host storage |
| 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 | 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 | 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 | Kafka | No SQL database |
| 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 | Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs (EF Core + Marten) | 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 | Kafka + PostgreSQL outbox/inbox | — |
| Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs | Durable Task Scheduler | — | Kafka | Host storage; no PostgreSQL |
| 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 | 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 | 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 | Kafka + Cosmos DB persistence | Foundry; no PostgreSQL |
| Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs | Chat Session Blob StorageContainerv1.0.0Chat Session Blob StorageAuthoritative Azure Blob Storage container owned by the Conversational bounded context for durable AG-UI multi-turn chat...Ownerai-capabilities-teamDiagramOpen docs | — | — | Foundry; no PostgreSQL, Redis, or Kafka |
| 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 | — (stateless) | — | — | — |
| Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs | — | Redis (FusionCache + idempotency) | Kafka | MailKit + Mjml.Net over SMTP; no PostgreSQL |
| Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs | Scheduler DatabaseContainerv1.0.0Scheduler DatabaseAuthoritative PostgreSQL database owned by the Platform bounded context for Quartz.NET job definitions, cluster locks, e...Ownerplatform-engineering-teamDiagramOpen docs | — | Kafka + PostgreSQL outbox/inbox | — |
Kafka Messaging Conventions
- Transport: Wolverine with Kafka transport and CloudEvents JSON serialization (propagates W3C trace context, request ID, and user identity).
- Default topic naming:
bookworm.{env}.{owner-service}.{topic-name}(exception:scheduler.process-vector-batchis unprefixed). - Dead-letter queues: One native dead-letter queue per service (
bookworm.{env}.{service}.dead-letter-queue). - Retry policy: Cooldowns of
50ms,250ms, and1swith full jitter before routing to the native dead-letter queue.
PostgreSQL Flexible Server
| Property | Development | Staging | Production |
|---|---|---|---|
| SKU / tier | Standard_B1ms (Burstable) | Standard_D2ds_v5 (General Purpose) | Standard_D4ds_v5 (General Purpose) |
| High availability | Disabled | Zone-redundant (zones 1 & 2) | Zone-redundant (zones 1 & 2) |
| Backup retention | 7 days | 14 days | 35 days |
| Geo-redundant backup | Disabled | Disabled | Enabled |
| Storage | 32 GB, auto-grow off | 128 GB, auto-grow on | 256 GB, auto-grow on |
| PgBouncer | Disabled | Enabled | Enabled |
Azure Managed Redis
| Property | Development | Staging | Production |
|---|---|---|---|
| SKU | BalancedB0 | BalancedB1 | BalancedB5 |
| High availability | Disabled | Enabled | Enabled |
Azure Cosmos DB
| Property | Development | Staging | Production |
|---|---|---|---|
| Capacity mode | Serverless | Serverless | Provisioned throughput |
| Local (key) auth | Enabled | Disabled | Disabled |
Azure Storage (publish mode only)
| Property | Development | Staging | Production |
|---|---|---|---|
| SKU | Standard_LRS | Standard_ZRS | Standard_GZRS |
| Access tier / TLS | Hot / TLS 1.2+ | Hot / TLS 1.2+ | Hot / TLS 1.2+ |
Foundry provisions SKU S0 with an Agents capability host and links Application Insights. All deployments use GlobalStandard capacity 1.
| Deployment | Model | Version | Purpose |
|---|---|---|---|
chat | model-router | 2025-11-18 | Chat completions and agent reasoning |
decision | Microsoft-Decision-1 | 1 | Chat workflow routing decisions |
embedding | embed-v-4-0 | 6 | Catalog vector embeddings |
Guardrails & Constraints
Azure Storage Blob CORS currently permits all origins (*, 1-hour cache), and Durable Task
Scheduler declares an open IP allowlist (0.0.0.0/0). Restrict both to known gateway and workload
boundaries before Production; see Production Hardening & Compliance ChecklistCustom DocProduction Hardening & Compliance ChecklistPre-production SecOps and reliability checklist for locking down network perimeters, scaling limits, backup drills, and ...Ownerplatform-engineering-teamOpen doc.
PostgreSQL hosts only Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs, and Scheduler DatabaseContainerv1.0.0Scheduler DatabaseAuthoritative PostgreSQL database owned by the Platform bounded context for Quartz.NET job definitions, cluster locks, e...Ownerplatform-engineering-teamDiagramOpen docs. Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs, 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, 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 Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs must never provision relational PostgreSQL databases.
Related Documentation
- Container Apps & Compute InventoryCustom DocContainer Apps & Compute InventoryReference inventory of all 16 Azure Container Apps, ingress ports, revision modes, and platform-owned runtime services.Ownerplatform-engineering-teamOpen doc — Workloads that consume these resources.
- Identity, Entra Agent Identities & RBAC MatrixCustom DocIdentity, Entra Agent Identities & RBAC MatrixReference for Microsoft Entra ID app registrations, Agent Identities for OBO token exchange, and per-service Managed Ide...Ownerplatform-engineering-teamOpen doc — Role assignments for each resource.
- Production Hardening & Compliance ChecklistCustom DocProduction Hardening & Compliance ChecklistPre-production SecOps and reliability checklist for locking down network perimeters, scaling limits, backup drills, and ...Ownerplatform-engineering-teamOpen doc — Network, backup, and quota hardening.
- Incident Triage & Health Check RunbookCustom DocIncident Triage & Health Check RunbookFirst-5-minutes triage commands and symptom-first recovery playbooks for Container Apps, passwordless RBAC, order orches...Ownerplatform-engineering-teamOpen doc — Datastore and messaging recovery steps.