ARCHOS 525 BLUEPRINT · /d/dgm_int-newsql
Distributed SQL (Spanner / CockroachDB) Internals (Raft Ranges & 2PC)
8 COMPONENTS · 7 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_int-newsql) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-newsql)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-newsql" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Distributed SQL (Spanner / CockroachDB) Internals (Raft Ranges & 2PC) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0["SQL Client"]
gw_1["SQL Gateway Node"]
hlc_2["TrueTime / HLC Clock"]
r1_3[("Range 1 Raft Group")]
r2_4[("Range 2 Raft Group")]
peb_5[("RocksDB / Pebble KV")]
fol_6[("Raft Followers")]
downstream_7["Downstream & OTel"]
client_0 -->|"1. BEGIN..COM · SQL"| gw_1
gw_1 -->|"2a. Stamp · Clock"| hlc_2
gw_1 -->|"2b. Stage TX · gRPC"| r1_3
gw_1 -->|"2c. Write · gRPC"| r2_4
r1_3 -->|"3a. Persist · LSM"| peb_5
r2_4 -->|"3b. Raft · Raft"| fol_6
fol_6 -.->|"4. Emit / · OTLP/API"| downstream_7COMPONENT STACK (8)
- SQL ClientSTATELESSSerializable TX
- SQL Gateway NodeSTATELESSDistributed SQL planner & 2PC coord
- TrueTime / HLC ClockSTATELESSBounded clock uncertainty [e]
- Range 1 Raft GroupSTATEFULKeys [A..M] · Leaseholder
- Range 2 Raft GroupSTATEFULKeys [N..Z] · Leaseholder
- RocksDB / Pebble KVSTATEFULMVCC timestamped intents
- Raft FollowersSTATEFULQuorum log replication
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (7)
- SQL Client → SQL Gateway Node (BEGIN..COM)[SQL]
- SQL Gateway Node → TrueTime / HLC Clock (Stamp)[Clock]
- SQL Gateway Node → Range 1 Raft Group (Stage TX)[gRPC]
- SQL Gateway Node → Range 2 Raft Group (Write)[gRPC]
- Range 1 Raft Group → RocksDB / Pebble KV (Persist)[LSM]
- Range 2 Raft Group → Raft Followers (Raft)[Raft]
- Raft Followers → Downstream & OTel (Emit /)[OTLP/API]