ARCHOS 525 BLUEPRINT · /d/dgm_dedupe-exactly-once
Effectively-once processing (transactional outbox and idempotent sink)
14 COMPONENTS · 14 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_dedupe-exactly-once) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_dedupe-exactly-once)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_dedupe-exactly-once" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Effectively-once processing (transactional outbox and idempotent sink) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("API Client")]
analyst_1[("Data Analyst")]
producer_2["Event producer"]
db_3[("PostgreSQL")]
relay_4[("Message relay")]
log_5[("Event log")]
consumer_6[("Idempotent consumer")]
sink_7[("Idempotent sink")]
dlq_8[("Dead-letter queue (DLQ)")]
metrics_9[("Traces, metrics and logs")]
alerting_10[("Alerting")]
capacity_11["Capacity card"]
gw_12["API gateway"]
secrets_13[("Secrets manager")]
client_0 -->|"1. Calls with JWT · HTTPS"| gw_12
gw_12 -->|"2. Forwards (HTTPS) · HTTPS"| producer_2
producer_2 -->|"3. Saves order and event (SQL) · SQL"| db_3
db_3 -->|"4. Reads new outbox rows (SQL) · SQL"| relay_4
relay_4 -->|"5. Publishes (TCP) · TCP"| log_5
log_5 -->|"6. Consumes (TCP) · TCP"| consumer_6
consumer_6 -->|"7a. Writes by event id (SQL) · SQL"| sink_7
consumer_6 -->|"7b. Parks poison events (TCP) · TCP"| dlq_8
sink_7 -->|"8. Answers queries (SQL) · SQL"| analyst_1
metrics_9 -->|"Scrapes metrics (HTTPS) · HTTPS"| consumer_6
metrics_9 -->|"Feeds alerts · HTTPS"| alerting_10
secrets_13 -->|"Supplies credentials (HTTPS) · HTTPS"| relay_4
secrets_13 -->|"Supplies credentials · HTTPS"| producer_2
secrets_13 -->|"Supplies credentials (HTTPS) · HTTPS"| consumer_6COMPONENT STACK (14)
- API ClientSTATEFULPlaces orders and retries
- Data AnalystSTATEFULReads order totals
- Event producerSTATELESSOrder service: writes the outbox row; relay publishes
- PostgreSQLSTATEFULOrder, outbox and key rows in one transaction
- Message relaySTATEFULForwards outbox rows and trace id; may repeat
- Event logSTATEFULPartitioned, replayable; keeps events 7 days
- Idempotent consumerSTATEFULSkips a message id it has already handled
- Idempotent sinkSTATEFULKeyed upsert; ids kept in the same store
- Dead-letter queue (DLQ)STATEFULParks events that fail on every attempt
- Traces, metrics and logsSTATEFULLatency, availability, lag and errors
- AlertingSTATEFULPages on-call when lag or dead letters grow
- Capacity cardSTATELESSIllustrative sizing for the drawn design
- API gatewaySTATELESSChecks the JWT and scope, stamps a trace id
- Secrets managerSTATEFULHolds database and broker credentials
REQUEST & DATA FLOW (14)
- API Client → API gateway (Calls with JWT)[HTTPS]
- API gateway → Event producer (Forwards (HTTPS))[HTTPS]
- Event producer → PostgreSQL (Saves order and event (SQL))[SQL]
- PostgreSQL → Message relay (Reads new outbox rows (SQL))[SQL]
- Message relay → Event log (Publishes (TCP))[TCP]
- Event log → Idempotent consumer (Consumes (TCP))[TCP]
- Idempotent consumer → Idempotent sink (Writes by event id (SQL))[SQL]
- Idempotent consumer → Dead-letter queue (DLQ) (Parks poison events (TCP))[TCP]
- Idempotent sink → Data Analyst (Answers queries (SQL))[SQL]
- Traces, metrics and logs → Idempotent consumer (Scrapes metrics (HTTPS))[HTTPS]
- Traces, metrics and logs → Alerting (Feeds alerts)[HTTPS]
- Secrets manager → Message relay (Supplies credentials (HTTPS))[HTTPS]
- Secrets manager → Event producer (Supplies credentials)[HTTPS]
- Secrets manager → Idempotent consumer (Supplies credentials (HTTPS))[HTTPS]