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

SQLite Internals (Single-File B-Tree, WAL Mode & Single Writer)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![SQLite Internals (Single-File B-Tree, WAL Mode & Single Writer) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-sqlite/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-sqlite)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-sqlite)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-sqlite" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="SQLite Internals (Single-File B-Tree, WAL Mode & Single Writer) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Embedded / Edge App"]
  n1_1["SQL Compiler & VDBE"]
  n2a_2[("Page Cache")]
  n2b_3[("WAL & Checkpointer")]
  n3_4[("Single .db File")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Exec VDBE · In-Proc"| n1_1
  n1_1 -->|"2a. Read page · RAM"| n2a_2
  n1_1 -.->|"2b. Append WAL · FS"| n2b_3
  n2a_2 -->|"3a. Checkpoint · POSIX"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Embedded / Edge AppSTATELESS
    In-process C library calls
  • SQL Compiler & VDBESTATELESS
    Bytecode VM query execution
  • Page CacheSTATEFUL
    4KB B-tree pages + mmap
  • WAL & CheckpointerSTATEFUL
    Append WAL + reader snapshots
  • Single `.db` FileSTATEFUL
    ACID B-tree + Litestream S3
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Embedded / Edge App → SQL Compiler & VDBE (Exec VDBE)[In-Proc]
  2. SQL Compiler & VDBE → Page Cache (Read page)[RAM]
  3. SQL Compiler & VDBE → WAL & Checkpointer (Append WAL)[FS]
  4. Page Cache → Single `.db` File (Checkpoint)[POSIX]
  5. WAL & Checkpointer → Single `.db` File (Sync)[Control]
  6. Single `.db` File → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →