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

Ledger / Double-Entry Store Internals (Serializable Journal & Checks)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Ledger / Double-Entry Store Internals (Serializable Journal & Checks) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-ledger-store/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-ledger-store)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-ledger-store)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-ledger-store" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Ledger / Double-Entry Store Internals (Serializable Journal & Checks) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Ledger API Services"]
  n1_1["Tx Coordinator"]
  n2a_2["Balance Invariant"]
  n2b_3[("Account Balance Row")]
  n3_4[("Immutable Journal")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Begin tx · SQL"| n1_1
  n1_1 -->|"2a. Verify 0 · SQL"| n2a_2
  n1_1 -.->|"2b. Upd bal · SQL"| n2b_3
  n2a_2 -->|"3a. Insert leg · SQL"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Ledger API ServicesSTATELESS
    Debits & credits transactions
  • Tx CoordinatorSTATELESS
    Idempotency key + sorted locks
  • Balance InvariantSTATELESS
    Check overdraft & zero-sum
  • Account Balance RowSTATEFUL
    Materialized posted/pending
  • Immutable JournalSTATEFUL
    Append-only hash-chained log
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Ledger API Services → Tx Coordinator (Begin tx)[SQL]
  2. Tx Coordinator → Balance Invariant (Verify 0)[SQL]
  3. Tx Coordinator → Account Balance Row (Upd bal)[SQL]
  4. Balance Invariant → Immutable Journal (Insert leg)[SQL]
  5. Account Balance Row → Immutable Journal (Sync)[Control]
  6. Immutable Journal → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →