Eventing model
How commands, events and queries are used across Acme Inc's event-driven commerce platform.
The catalog separates messages by intent.
- Commands ask another capability to do something.
- Events announce that something has already happened.
- Queries request information without changing state.
Commands
Commands are named in the imperative and should have one clear handler. Examples:
- Checkout CartCommandv1.0.0Checkout CartCommand to check out a shopping cart. Ownershopping-platformSchemaDiagramOpen docs asks Cart APIServicev1.0.0Cart APIThe public-facing API for shopping carts. Handles commands to add and remove items and to check out, and publishes an ev...Publishescart-checked-out, calculate-discountSubscribesadd-item-to-cart, remove-item-from-cart +1APIsOpenAPIOwnershopping-platformDiagramRepositoryOpen docs to check out a cart.
- Reserve InventoryCommandv1.0.0Reserve InventoryCommand to reserve stock for the items in a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs asks Inventory ServiceServicev1.0.0Inventory ServiceThe system of record for stock. Reserves and releases inventory, serves stock-level queries, and publishes events when s...Publishesinventory-reserved, inventory-unavailableSubscribesreserve-inventory, release-inventory +2Ownerfulfilment-platformDiagramRepositoryOpen docs to hold stock.
- Authorize PaymentCommandv1.0.0Authorize PaymentCommand to authorize payment for the total of a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs asks Payment APIServicev1.0.0Payment APIReceives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformDiagramRepositoryOpen docs to authorize payment.
- Create OrderCommandv1.0.0Create OrderCommand to create a new order from a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs asks Order ServiceServicev1.0.0Order ServiceThe system of record for orders. Creates and cancels orders, serves order lookups, and publishes events as orders move t...Publishesorder-created, order-confirmed +9Subscribescreate-order, cancel-order +2APIsAsyncAPIOwnerordering-platformDiagramRepositoryOpen docs to create an order.
- Submit ReviewCommandv1.0.0Submit ReviewCommand issued by a customer to submit a review and rating for a product. Ownerreviews-platformSchemaDiagramOpen docs asks Review APIServicev1.0.0Review APIThe public-facing API for product reviews. Accepts review submissions, serves published reviews, and is the entry point ...Publishesreview-submitted, review-flagged +1Subscribessubmit-review, flag-review +2Ownerreviews-platformDiagramRepositoryOpen docs to accept a product review.
Events
Events are facts and should be safe for multiple consumers. Examples:
- Cart Checked OutEventv1.0.0Cart Checked OutPublished when a customer has checked out their cart. Ownershopping-platformSchemaDiagramOpen docs starts the checkout process.
- Order CreatedEventv1.0.0Order CreatedPublished when a new order has been created. Ownerordering-platformSchemaDiagramOpen docs signals that an order exists.
- Payment SucceededEventv1.0.0Payment SucceededPublished by Stripe when a charge succeeds. Ownerpayments-platformSchemaDiagramOpen docs and Payment FailedEventv1.0.0Payment FailedPublished by Stripe when a charge fails. Ownerpayments-platformSchemaDiagramOpen docs report external processor outcomes.
- Order Ready For ShippingEventv1.0.0Order Ready For ShippingPublished when a packed order is ready to be handed to a carrier for shipping. Ownerfulfilment-platformSchemaDiagramOpen docs hands fulfilment to shipping.
- Review PublishedEventv1.0.0Review PublishedPublished when a submitted review passes moderation and becomes visible on the storefront. Ownerreviews-platformSchemaDiagramOpen docs updates review read models and product trust signals.
Queries
Queries are explicit read contracts. Examples include Get ProductQueryv1.0.0Get ProductQuery to fetch a single product by its identifier. Ownerproduct-platformSchemaDiagramOpen docs, Search ProductsQueryv1.0.0Search ProductsQuery to search the catalog for products matching a term, with optional filters and pagination. Ownersearch-platformSchemaDiagramOpen docs, Get OrderQueryv1.0.0Get OrderQuery to fetch a single order by its identifier. Ownerordering-platformSchemaDiagramOpen docs, Get CustomerQueryv1.0.0Get CustomerQuery to fetch a single customer by their identifier. Ownercustomer-platformSchemaDiagramOpen docs, Get Stock LevelQueryv1.0.0Get Stock LevelQuery to fetch the current available stock level for a product. Ownerfulfilment-platformSchemaDiagramOpen docs and Get Product ReviewsQueryv1.0.0Get Product ReviewsQuery to fetch the published reviews and aggregate rating for a product. Ownerreviews-platformSchemaDiagramOpen docs.
Versioning expectations
Backward-compatible additions are preferred. Removing fields or changing semantics requires a versioned contract and a migration plan. For customer-critical flows, review the flow page and all participating messages before changing a schema.
Failure expectations
Consumers should be idempotent. Producers should publish facts after durable state changes. Long-running processes should persist their progress, especially Checkout SagaFlowv1.0.0Checkout SagaHow the Checkout Orchestrator turns a checked-out cart into an order — reserving inventory, authorizing payment and crea...Ownerordering-platformView flowOpen docs, payment processing, search indexing and review moderation.