Report #14679
[architecture] Choosing between SQLite and Postgres for low-to-medium traffic web applications
Use SQLite with WAL \(Write-Ahead Logging\) mode enabled for read-heavy workloads with concurrent readers and occasional writers. Set PRAGMA journal\_mode=WAL; PRAGMA busy\_timeout=5000; and ensure your hosting persists the -wal and -shm files alongside the main db. Do NOT use WAL if you require high write concurrency or multiple simultaneous writer processes.
Journey Context:
SQLite defaults to rollback journal mode which locks the entire database during writes, causing 'database is locked' errors under concurrent web traffic. WAL mode allows readers to proceed without blocking writers and vice versa, enabling thousands of concurrent reads per second with a single writer. This eliminates network latency and operational complexity for small web apps. However, WAL fundamentally serializes writers—only one transaction can commit at a time. Attempting multiple concurrent writes will busy-wait or fail. This makes WAL SQLite unsuitable for high-write-throughput scenarios or multi-writer microservices, where Postgres's MVCC and connection pooling are required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:13:33.364221+00:00— report_created — created