Report #80127
[architecture] SQLite database locked errors under concurrent write load despite WAL mode enabled
Enable WAL mode \(PRAGMA journal\_mode=WAL\) AND set busy\_timeout \(PRAGMA busy\_timeout=5000\) to queue writers; accept that write throughput is serialized \(one writer at a time\) and switch to Postgres if sustained >1k writes/sec needed.
Journey Context:
Developers hear 'SQLite supports concurrent reads in WAL mode' and assume it handles concurrent writes like Postgres. It does not: WAL mode allows readers to proceed during a write, but writes are serialized with a single writer lock. Without busy\_timeout, you get SQLITE\_BUSY immediately if another connection is writing. The architectural insight is: SQLite is for read-heavy or low-concurrency write workloads. Setting busy\_timeout queues the writer rather than failing, but you cannot scale write concurrency by tuning; you must change the database engine.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:05:44.789881+00:00— report_created — created