Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-unique-dedupe-store

Idempotency Store Internals (State Machine, Locks & TTL)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Idempotency Store Internals (State Machine, Locks & TTL) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-unique-dedupe-store/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-unique-dedupe-store)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-unique-dedupe-store)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-unique-dedupe-store" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Idempotency Store Internals (State Machine, Locks & TTL) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Payment & Mutation APIs"]
  n1_1["Idempotency Guard"]
  n2a_2[("Atomic Lock Store")]
  n2b_3[("Response Cache")]
  n3_4["TTL Reaper Job"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Check key · HTTPS"| n1_1
  n1_1 -->|"2a. Claim key · SQL"| n2a_2
  n1_1 -.->|"2b. Save resp · Redis"| n2b_3
  n2a_2 -->|"3a. Expire old · SQL"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Payment & Mutation APIsSTATELESS
    Retried non-idempotent POSTs
  • Idempotency GuardSTATELESS
    Extract key + payload hash
  • Atomic Lock StoreSTATEFUL
    INSERT ON CONFLICT -> lock
  • Response CacheSTATEFUL
    Replay exact saved 200 JSON
  • TTL Reaper JobSTATELESS
    24h-7d retention window
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Payment & Mutation APIs → Idempotency Guard (Check key)[HTTPS]
  2. Idempotency Guard → Atomic Lock Store (Claim key)[SQL]
  3. Idempotency Guard → Response Cache (Save resp)[Redis]
  4. Atomic Lock Store → TTL Reaper Job (Expire old)[SQL]
  5. Response Cache → TTL Reaper Job (Sync)[Control]
  6. TTL Reaper Job → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →