Skip to main content
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
[![Effectively-once processing (transactional outbox and idempotent sink) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_dedupe-exactly-once/opengraph-image)](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_6

COMPONENT STACK (14)

  • API ClientSTATEFUL
    Places orders and retries
  • Data AnalystSTATEFUL
    Reads order totals
  • Event producerSTATELESS
    Order service: writes the outbox row; relay publishes
  • PostgreSQLSTATEFUL
    Order, outbox and key rows in one transaction
  • Message relaySTATEFUL
    Forwards outbox rows and trace id; may repeat
  • Event logSTATEFUL
    Partitioned, replayable; keeps events 7 days
  • Idempotent consumerSTATEFUL
    Skips a message id it has already handled
  • Idempotent sinkSTATEFUL
    Keyed upsert; ids kept in the same store
  • Dead-letter queue (DLQ)STATEFUL
    Parks events that fail on every attempt
  • Traces, metrics and logsSTATEFUL
    Latency, availability, lag and errors
  • AlertingSTATEFUL
    Pages on-call when lag or dead letters grow
  • Capacity cardSTATELESS
    Illustrative sizing for the drawn design
  • API gatewaySTATELESS
    Checks the JWT and scope, stamps a trace id
  • Secrets managerSTATEFUL
    Holds database and broker credentials

REQUEST & DATA FLOW (14)

  1. API Client → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Event producer (Forwards (HTTPS))[HTTPS]
  3. Event producer → PostgreSQL (Saves order and event (SQL))[SQL]
  4. PostgreSQL → Message relay (Reads new outbox rows (SQL))[SQL]
  5. Message relay → Event log (Publishes (TCP))[TCP]
  6. Event log → Idempotent consumer (Consumes (TCP))[TCP]
  7. Idempotent consumer → Idempotent sink (Writes by event id (SQL))[SQL]
  8. Idempotent consumer → Dead-letter queue (DLQ) (Parks poison events (TCP))[TCP]
  9. Idempotent sink → Data Analyst (Answers queries (SQL))[SQL]
  10. Traces, metrics and logs → Idempotent consumer (Scrapes metrics (HTTPS))[HTTPS]
  11. Traces, metrics and logs → Alerting (Feeds alerts)[HTTPS]
  12. Secrets manager → Message relay (Supplies credentials (HTTPS))[HTTPS]
  13. Secrets manager → Event producer (Supplies credentials)[HTTPS]
  14. Secrets manager → Idempotent consumer (Supplies credentials (HTTPS))[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →