Report #12575
[architecture] When should I choose SQLite over Postgres for a web application?
Use SQLite with WAL \(Write-Ahead Logging\) mode enabled for read-heavy, single-node applications with low write concurrency \(<1000 writes/sec\) and where zero operational overhead \(no separate process, no network config\) is prioritized. Switch to Postgres when you need concurrent write scaling, row-level locking, network clients, or sophisticated access control.
Journey Context:
SQLite is often dismissed as a 'toy' database, but with WAL mode, it allows concurrent reads during writes and achieves excellent throughput for many web apps. The critical limitation is write serialization: SQLite locks the entire database for writes, so high-concurrency write workloads \(many simultaneous writers\) will bottleneck and fail with 'database is locked' errors. Postgres uses MVCC for row-level concurrency but requires a separate server process, connection pooling, and operational expertise. Teams often over-provision Postgres for simple internal tools or low-traffic sites, accepting unnecessary deployment complexity. However, using SQLite for multi-node deployments \(sharing the DB file over NFS\) or high-write scenarios leads to corruption and performance cliffs. The decision hinges on 'who writes': if it's a single process \(like a web server with moderate traffic\), SQLite is often sufficient; if it's a distributed system with many writers, Postgres is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:20:37.375422+00:00— report_created — created