Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_transactions-and-isolation

Transactions and Isolation Ladder (locks, snapshots, serializable, two-phase commit)

12 COMPONENTS · 16 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[![Transactions and Isolation Ladder (locks, snapshots, serializable, two-phase commit) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_transactions-and-isolation/opengraph-image)](https://archos.sageideas.dev/d/dgm_transactions-and-isolation)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_transactions-and-isolation)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_transactions-and-isolation" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Transactions and Isolation Ladder (locks, snapshots, serializable, two-phase commit) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Account holder")]
  analyst_1[("Finance analyst")]
  gw_2["API gateway"]
  svca_3["Ledger service"]
  svcb_4["Limits service"]
  svcc_5["Settlement service"]
  metrics_6[("Traces, metrics and logs")]
  kv_7[("Key-value store")]
  pg_8[("PostgreSQL")]
  coord_9[("Transaction coordinator")]
  ns_10[("Distributed SQL (NewSQL)")]
  capacity_11["Capacity card"]
  client_0 -->|"1. Calls with JWT · HTTPS"| gw_2
  gw_2 -->|"2a. Forwards (mTLS) · HTTP/2"| svca_3
  gw_2 -->|"2b. Forwards (mTLS) · HTTP/2"| svcb_4
  gw_2 -->|"2c. Forwards (mTLS) · HTTP/2"| svcc_5
  svca_3 -->|"3a. Locks rows (SQL) · SQL"| pg_8
  svcb_4 -->|"3b. Checks version · HTTPS"| kv_7
  svcc_5 -->|"3c. Starts commit · HTTP/2"| coord_9
  coord_9 -->|"4a. Prepares (SQL) · SQL"| pg_8
  coord_9 -->|"4b. Prepares (SQL) · SQL"| ns_10
  pg_8 -->|"4c. No-gateway reads (SQL) · SQL"| analyst_1
  pg_8 -->|"5a. Votes yes or no · SQL"| coord_9
  ns_10 -->|"5b. Votes yes or no · SQL"| coord_9
  coord_9 -->|"6. Reports outcome · HTTP/2"| svcc_5
  metrics_6 -->|"Scrapes (HTTPS) · HTTPS"| svca_3
  metrics_6 -->|"Scrapes (HTTPS) · HTTPS"| coord_9
  metrics_6 -->|"Scrapes (HTTPS) · HTTPS"| pg_8

COMPONENT STACK (12)

  • Account holderSTATEFUL
    Moves money between two accounts
  • Finance analystSTATEFUL
    Read-only role; replica in prod
  • API gatewaySTATELESS
    Checks the JWT before any transfer starts
  • Ledger serviceSTATELESS
    Moves money under row locks
  • Limits serviceSTATELESS
    Updates a daily limit if no one else did
  • Settlement serviceSTATELESS
    Settles across two databases at once
  • Traces, metrics and logsSTATEFUL
    Lock wait, abort rate, oldest prepared transaction
  • Key-value storeSTATEFUL
    Item is written only if its version matches
  • PostgreSQLSTATEFUL
    Snapshot reads; row locks with FOR UPDATE
  • Transaction coordinatorSTATEFUL
    Asks both databases to prepare, then commit
  • Distributed SQL (NewSQL)STATEFUL
    Serializable transactions; retry on conflict
  • Capacity cardSTATELESS
    Illustrative sizing for the drawn design

REQUEST & DATA FLOW (16)

  1. Account holder → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Ledger service (Forwards (mTLS))[HTTP/2]
  3. API gateway → Limits service (Forwards (mTLS))[HTTP/2]
  4. API gateway → Settlement service (Forwards (mTLS))[HTTP/2]
  5. Ledger service → PostgreSQL (Locks rows (SQL))[SQL]
  6. Limits service → Key-value store (Checks version)[HTTPS]
  7. Settlement service → Transaction coordinator (Starts commit)[HTTP/2]
  8. Transaction coordinator → PostgreSQL (Prepares (SQL))[SQL]
  9. Transaction coordinator → Distributed SQL (NewSQL) (Prepares (SQL))[SQL]
  10. PostgreSQL → Finance analyst (No-gateway reads (SQL))[SQL]
  11. PostgreSQL → Transaction coordinator (Votes yes or no)[SQL]
  12. Distributed SQL (NewSQL) → Transaction coordinator (Votes yes or no)[SQL]
  13. Transaction coordinator → Settlement service (Reports outcome)[HTTP/2]
  14. Traces, metrics and logs → Ledger service (Scrapes (HTTPS))[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →