Report #88286
[architecture] Should I use PostgreSQL or SQLite for my small web application?
Choose SQLite for single-node, read-heavy applications with <1000 concurrent writes/second where operational simplicity \(zero config, embedded\) outweighs the need for network access, row-level locking, or complex access control; use Postgres for high-write concurrency, row-level locking, or multi-node access.
Journey Context:
Developers default to Postgres due to 'web scale' anxiety, introducing Docker, connection pooling, and backup complexity for blogs or internal tools. SQLite's 'serverless' nature eliminates network latency \(sub-millisecond vs 1-2ms for local Postgres\), simplifies testing \(in-memory :memory: databases\), and removes deployment friction. SQLite handles concurrency via WAL mode \(write-ahead logging\) but locks at the database level, not row level, making it unsuitable for high-write contention. Critical constraints: never use SQLite on NFS or network storage \(corruption risk\), and enable WAL mode \(journal\_mode=WAL\) for concurrent reads during writes. The litmus test: if you don't need a separate server process, you don't need Postgres.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:46:15.596777+00:00— report_created — created