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
[](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_8COMPONENT STACK (12)
- Account holderSTATEFULMoves money between two accounts
- Finance analystSTATEFULRead-only role; replica in prod
- API gatewaySTATELESSChecks the JWT before any transfer starts
- Ledger serviceSTATELESSMoves money under row locks
- Limits serviceSTATELESSUpdates a daily limit if no one else did
- Settlement serviceSTATELESSSettles across two databases at once
- Traces, metrics and logsSTATEFULLock wait, abort rate, oldest prepared transaction
- Key-value storeSTATEFULItem is written only if its version matches
- PostgreSQLSTATEFULSnapshot reads; row locks with FOR UPDATE
- Transaction coordinatorSTATEFULAsks both databases to prepare, then commit
- Distributed SQL (NewSQL)STATEFULSerializable transactions; retry on conflict
- Capacity cardSTATELESSIllustrative sizing for the drawn design
REQUEST & DATA FLOW (16)
- Account holder → API gateway (Calls with JWT)[HTTPS]
- API gateway → Ledger service (Forwards (mTLS))[HTTP/2]
- API gateway → Limits service (Forwards (mTLS))[HTTP/2]
- API gateway → Settlement service (Forwards (mTLS))[HTTP/2]
- Ledger service → PostgreSQL (Locks rows (SQL))[SQL]
- Limits service → Key-value store (Checks version)[HTTPS]
- Settlement service → Transaction coordinator (Starts commit)[HTTP/2]
- Transaction coordinator → PostgreSQL (Prepares (SQL))[SQL]
- Transaction coordinator → Distributed SQL (NewSQL) (Prepares (SQL))[SQL]
- PostgreSQL → Finance analyst (No-gateway reads (SQL))[SQL]
- PostgreSQL → Transaction coordinator (Votes yes or no)[SQL]
- Distributed SQL (NewSQL) → Transaction coordinator (Votes yes or no)[SQL]
- Transaction coordinator → Settlement service (Reports outcome)[HTTP/2]
- Traces, metrics and logs → Ledger service (Scrapes (HTTPS))[HTTPS]