Report #60883
[architecture] Over-provisioning PostgreSQL for low-write web apps when SQLite would suffice
Use SQLite with WAL mode \(PRAGMA journal\_mode=WAL; PRAGMA busy\_timeout=5000;\) for single-node deployments with moderate write concurrency \(<1k TPS\) and read-heavy workloads. Implement connection pooling at the application level \(e.g., better-sqlite3 with worker threads, sqlitex\) to prevent 'database is locked' errors under concurrent writes. Use Litestream for continuous backup to S3.
Journey Context:
Teams default to Postgres due to 'production' signaling, adding network latency, connection pool management, and operational complexity \(vacuum, replication\) for apps that don't need concurrent write scaling. SQLite with WAL \(Write-Ahead Logging\) allows readers to not block writers and writers to not block readers. The 'database is locked' error stems from default journal\_mode=DELETE and lack of busy\_timeout. SQLite is faster for single-node workloads due to in-process latency \(no IPC\). The real constraint is single-node \(no read replicas\), not performance; most SaaS apps under 10k users fit on one node.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:40:43.096086+00:00— report_created — created