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 Ordering bounded context for buyers, accepted orders, purchase-time line items, and order lifecycle event streams.

DatabasepostgresqlResidency: eastasiaRetention: indefiniteAccess Mode: readWriteDatabase

Purpose & Ownership Boundary

Order Database (orderingdb) is the authoritative PostgreSQL system of record owned exclusively by 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 in the Ordering bounded context. PostgreSQL was chosen to combine ACID relational persistence for buyer profiles and immutable checkout snapshots with append-only order lifecycle event streams, read projections, and a transactional outbox over a single connection.

Data Store Profile

PropertyValue
Bounded Context / OwnerOrdering — Commerce Fulfillment TeamTeamCommerce Fulfillment TeamStream-Aligned team owning customer shopping baskets, checkout coordination, order lifecycle, and financial saga orchest...Open docs
Engine / TechnologyPostgreSQL 18 (Azure Database for PostgreSQL Flexible Server)
Store TypeDatabase
Primary Writer(s)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
Primary Reader(s)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
Authoritative / Source of TruthYes
Data ClassificationConfidential (contains customer names and shipping addresses)
Retention / TTL PolicyIndefinite (soft-delete on orders; subject to environment data-governance policy)

Logical Data Layout & Key Patterns

Table / SchemaOwned EntityPartition / Primary KeyPurpose & Concurrency
buyersBuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docsid (uuidv7())Customer profiles including name and shipping address (street, city, province).
ordersOrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docsid (uuidv7())Accepted orders with status (New, Cancelled, Completed), order note, timestamps, and soft-delete flag; optimistic concurrency via row-version token.
order_itemsOrder ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docsid (uuidv7()), unique (book_id, order_id)Immutable checkout-time line item snapshots locking book_id, quantity, and unit price at purchase time.
Event store (public)OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docsStream ID (order_id)Append-only order placement, completion, and cancellation events; live stream aggregation and asynchronous summary projection (DaemonLockId = 44444).
wolverine schema—Envelope IDTransactional outbox and inbox tables sharing the domain write transaction; partitions Kafka events (User checked outEventv1.0.0User checked outReports that an Order was placed and its checkout details are ready for Finance coordination. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Order completedEventv1.0.0Order completedReports that an Order transitioned from New to Completed. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Order cancelledEventv1.0.0Order cancelledReports that an Order transitioned from New to Cancelled. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs) by OrderId.

Consistency, Isolation & Security Guardrails

  • Checkout price immutability: order_items persists the unit price resolved at checkout so subsequent price edits 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 never alter historical purchases.
  • Soft-delete audit preservation: Administrative cleanup and failed basket-cleanup compensation mark orders as soft-deleted (filtered from normal reads) rather than physically erasing rows.
  • Eventually consistent summary views: Asynchronous order summary projections can briefly lag transactional writes; orders remains the canonical source for order status.
  • Confidential PII posture: Buyer names and street/city/province addresses are classified confidential and protected by encryption at rest, regional residency, and backup retention policies.
Warning

Database-per-Service Isolation: Only 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 may read or write orderingdb. Active pre-checkout baskets live in 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, temporary locks and HTTP idempotency markers live in 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 post-checkout saga state lives in 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. External services must never query orderingdb directly.

Operational & Resilience Notes

Architecture Visualizations

Loading graph...