Report #97075
[architecture] SQLite 'database is locked' errors under concurrent load despite being 'serverless'
Enable WAL \(Write-Ahead Logging\) mode via PRAGMA journal\_mode=WAL. This allows readers to proceed without blocking writers and vice versa. Suitable for single-node deployments with <1000 TPS write volume and many concurrent readers. Do not use WAL over network filesystems \(NFS\).
Journey Context:
Default SQLite rollback journals require exclusive locks on the entire database file during writes, causing SQLITE\_BUSY errors for concurrent connections. WAL mode moves changes to a separate log file \(-wal\), allowing the original database to remain readable by other connections. Writers append to the log; readers work from the last checkpointed snapshot. This eliminates reader/writer contention but does not scale writes horizontally \(still single-writer\). Checkpoints \(merging wal into db\) happen automatically but can be tuned. Critical for edge deployments, Electron apps, or small Go services where Postgres connection overhead \(megabytes per connection\) outweighs SQLite's file-based simplicity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:31:26.796377+00:00— report_created — created