ARCHOS 525 BLUEPRINT · /d/dgm_async-decoupling
Order Processing (async decoupling with queues and events)
13 COMPONENTS · 13 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_async-decoupling) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_async-decoupling)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_async-decoupling" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Order Processing (async decoupling with queues and events) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("API Client")]
sink_mail_1[("Email Provider")]
prod_2["Event producer"]
sor_3[("System of record")]
relay_4[("Message relay")]
topic_5[("Publish-subscribe")]
q_mail_6[("Message queue")]
q_index_7[("Message queue")]
dlq_8[("Dead-letter queue (DLQ)")]
w_mail_9["Competing consumers"]
w_index_10["Competing consumers"]
search_11[("Search index")]
capacity_12["Capacity Estimate"]
client_0 -->|"1. Submits order · HTTPS"| prod_2
prod_2 -->|"2a. Saves order, outbox (SQL) · SQL"| sor_3
prod_2 -->|"2b. Replies 202 · HTTPS"| client_0
sor_3 -->|"3. Reads outbox (SQL) · SQL"| relay_4
relay_4 -.->|"4. Publishes event · Publish-subscribe"| topic_5
topic_5 -.->|"5a. Fans out · Publish-subscribe"| q_mail_6
topic_5 -.->|"5b. Fans out · Publish-subscribe"| q_index_7
q_mail_6 -.->|"6a. Pulls work · Message queue"| w_mail_9
q_index_7 -.->|"6b. Pulls work · Message queue"| w_index_10
q_mail_6 -.->|"6c. Parks poison messages · Message queue"| dlq_8
q_index_7 -.->|"6d. Parks poison messages · Message queue"| dlq_8
w_mail_9 -->|"7a. Sends email (HTTPS) · HTTPS"| sink_mail_1
w_index_10 -->|"7b. Updates index · HTTPS"| search_11COMPONENT STACK (12)
- API ClientSTATEFULPlaces an order from a browser or app
- Email ProviderSTATEFULThird-party service that sends the email
- Event producerSTATELESSOrder service: saves the order, replies 202
- System of recordSTATEFULOrder store: holds each order and its outbox row
- Message relaySTATEFULReads new outbox rows and publishes them
- Publish-subscribeSTATEFULOrder events topic: each subscriber gets a copy
- Message queueSTATEFULEmail queue: holds email jobs
- Message queueSTATEFULIndex queue: holds search-index jobs
- Dead-letter queue (DLQ)STATEFULParks failing messages from both queues
- Competing consumersSTATELESSEmail workers; dedupe not drawn
- Competing consumersSTATELESSIndex workers: add more when depth grows
- Search indexSTATEFULDerived copy of orders for fast search
REQUEST & DATA FLOW (13)
- API Client → Event producer (Submits order)[HTTPS]
- Event producer → System of record (Saves order, outbox (SQL))[SQL]
- Event producer → API Client (Replies 202)[HTTPS]
- System of record → Message relay (Reads outbox (SQL))[SQL]
- Message relay → Publish-subscribe (Publishes event)[Publish-subscribe]
- Publish-subscribe → Message queue (Fans out)[Publish-subscribe]
- Publish-subscribe → Message queue (Fans out)[Publish-subscribe]
- Message queue → Competing consumers (Pulls work)[Message queue]
- Message queue → Competing consumers (Pulls work)[Message queue]
- Message queue → Dead-letter queue (DLQ) (Parks poison messages)[Message queue]
- Message queue → Dead-letter queue (DLQ) (Parks poison messages)[Message queue]
- Competing consumers → Email Provider (Sends email (HTTPS))[HTTPS]
- Competing consumers → Search index (Updates index)[HTTPS]