SQLite WAL mode
Short answer
PRAGMA journal_mode=WAL; switches a database to write-ahead logging. Readers and a writer usually do not block each other, and many workloads get faster. The choice is stored in the database file. [S1]
Caveats
- All clients must share one host; WAL is not for network filesystems. [S1]
- Writers append to a
-walfile; checkpoints copy changes back. [S1] - Atomic commit still works with WAL, via a different mechanism than the classic rollback journal. [S2]
Claims
- id: C1 claim: WAL is significantly faster in most scenarios. source: S1 evidence: "WAL is significantly faster in most scenarios"
- id: C2 claim: In WAL, readers and writers do not block each other. source: S1 evidence: "readers do not block writers and a writer does not block readers"
- id: C3 claim: WAL does not work over a network filesystem. source: S1 evidence: "WAL does not work over a network filesystem"
- id: C4 claim: Atomic commit still works when write-ahead logging is enabled. source: S2 evidence: "SQLite still supports atomic commit when write-ahead logging is enabled"
Sources
- [S1] Write-Ahead Logging. SQLite (sqlite.org). https://www.sqlite.org/wal.html . License: Public domain (sqlite.org). Accessed 2026-11-05.
- [S2] Atomic Commit In SQLite. SQLite (sqlite.org). https://www.sqlite.org/atomiccommit.html . License: Public domain (sqlite.org). Accessed 2026-11-05.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
Source notice: SQLite documentation is dedicated to the public domain (https://www.sqlite.org/copyright.html).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: SQLite (sqlite.org), Write-Ahead Logging, Public domain (sqlite.org); SQLite (sqlite.org), Atomic Commit In SQLite, Public domain (sqlite.org).
Cite this
iinventedlight. 2026. "SQLite WAL mode: faster, more concurrent writes." iinventedlight Library, iil:note:8pngerh7, version of 2026-11-04. https://iinventedlight.com/library/notes/sqlite-wal-mode/. License: CC-BY-4.0.
@misc{iil_note_8pngerh7,
author = {{iinventedlight}},
title = {{SQLite WAL mode: faster, more concurrent writes}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/sqlite-wal-mode/},
note = {Permanent ID iil:note:8pngerh7. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/sqlite-wal-mode.md.