Report #11612
[architecture] SQLite 'database is locked' errors under concurrent write load
Enable WAL \(Write-Ahead Logging\) mode: PRAGMA journal\_mode=WAL; This allows readers to proceed without blocking writers and vice versa, supporting multiple concurrent connections
Journey Context:
Default SQLite journal mode \(DELETE\) uses coarse locking: only one writer at a time, readers block writers. This causes contention in web apps with concurrent requests. WAL mode writes changes to separate WAL file, allowing readers to access old snapshot while writer appends. Writers still serialize but don't block readers. Tradeoff: slightly slower for pure single-threaded workloads, requires checkpointing \(automatic or manual\) to merge WAL into main db. Not suitable for network filesystems. For read-heavy workloads with occasional writes, WAL is transformative; for high-write concurrency, Postgres is still better but WAL makes SQLite viable for small-to-medium concurrent web apps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:46:56.993233+00:00— report_created — created