Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_ecommerce-checkout

E-commerce Checkout and Orders (saga with transactional outbox)

17 COMPONENTS · 16 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[![E-commerce Checkout and Orders (saga with transactional outbox) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_ecommerce-checkout/opengraph-image)](https://archos.sageideas.dev/d/dgm_ecommerce-checkout)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_ecommerce-checkout)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_ecommerce-checkout" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="E-commerce Checkout and Orders (saga with transactional outbox) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  shopper_0[("Shopper")]
  provider_1[("Payment provider")]
  gw_2["API gateway"]
  policy_3["Policy decision point (PDP)"]
  metrics_4[("Traces, metrics and logs")]
  alerting_5[("Alerting")]
  checkout_6["Checkout service"]
  relay_7[("Message relay")]
  orch_8["Saga orchestrator"]
  inv_9[("Inventory store")]
  db_10[("System of record")]
  queue_11[("Message queue")]
  secrets_12[("Secrets manager")]
  cache_13[("Distributed cache")]
  catalog_14[("Catalog database")]
  dlq_15[("Dead-letter queue (DLQ)")]
  capacity_16["Capacity card"]
  shopper_0 -->|"1. Calls with JWT · HTTPS"| gw_2
  gw_2 -->|"2. Forwards (mTLS) · HTTP/2"| checkout_6
  checkout_6 -->|"3a. Reads price · RESP"| cache_13
  checkout_6 -->|"3b. Reads on miss (SQL) · SQL"| catalog_14
  checkout_6 -->|"3c. Saves order (SQL) · SQL"| db_10
  db_10 -->|"4. Reads outbox rows (SQL) · SQL"| relay_7
  relay_7 -->|"5. Publishes (TCP) · TCP"| queue_11
  queue_11 -->|"6. Consumes (TCP) · TCP"| orch_8
  orch_8 -->|"7a. Reserves · HTTPS"| inv_9
  orch_8 -->|"7b. Charges with key · HTTPS"| provider_1
  orch_8 -->|"7c. Parks poison events · TCP"| dlq_15
  provider_1 -->|"8. Returns charge result · HTTPS"| orch_8
  checkout_6 -->|"Asks permission (mTLS) · gRPC"| policy_3
  secrets_12 -->|"Supplies credentials · HTTPS"| orch_8
  metrics_4 -->|"Scrapes errors (HTTPS) · HTTPS"| orch_8
  metrics_4 -->|"Feeds alerts · HTTPS"| alerting_5

COMPONENT STACK (17)

  • ShopperSTATEFUL
    Places an order from a phone or browser
  • Payment providerSTATEFUL
    Same key returns the first result
  • API gatewaySTATELESS
    Checks the JWT, stamps a trace id
  • Policy decision point (PDP)STATELESS
    Decides if this user may place this order
  • Traces, metrics and logsSTATEFUL
    Orchestrator errors and retries
  • AlertingSTATEFUL
    Pages on-call when errors or dead letters grow
  • Checkout serviceSTATELESS
    Prices the cart, saves order and outbox row
  • Message relaySTATEFUL
    Copies outbox rows to the queue; may repeat
  • Saga orchestratorSTATELESS
    Reserves stock, charges, confirms or undoes
  • Inventory storeSTATEFUL
    Stock rows; conditional write stores the order id
  • System of recordSTATEFUL
    Orders, outbox and key rows in one transaction
  • Message queueSTATEFUL
    Holds order events for the saga
  • Secrets managerSTATEFUL
    Holds database, queue and payment keys
  • Distributed cacheSTATEFUL
    Prices are read here first (cache-aside)
  • Catalog databaseSTATEFUL
    Product prices, read on a cache miss
  • Dead-letter queue (DLQ)STATEFUL
    Parks events that fail every attempt

REQUEST & DATA FLOW (16)

  1. Shopper → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Checkout service (Forwards (mTLS))[HTTP/2]
  3. Checkout service → Distributed cache (Reads price)[RESP]
  4. Checkout service → Catalog database (Reads on miss (SQL))[SQL]
  5. Checkout service → System of record (Saves order (SQL))[SQL]
  6. System of record → Message relay (Reads outbox rows (SQL))[SQL]
  7. Message relay → Message queue (Publishes (TCP))[TCP]
  8. Message queue → Saga orchestrator (Consumes (TCP))[TCP]
  9. Saga orchestrator → Inventory store (Reserves)[HTTPS]
  10. Saga orchestrator → Payment provider (Charges with key)[HTTPS]
  11. Saga orchestrator → Dead-letter queue (DLQ) (Parks poison events)[TCP]
  12. Payment provider → Saga orchestrator (Returns charge result)[HTTPS]
  13. Checkout service → Policy decision point (PDP) (Asks permission (mTLS))[gRPC]
  14. Secrets manager → Saga orchestrator (Supplies credentials)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →