Report #5159
[architecture] When is SQLite preferable to Postgres for web application backends
Use SQLite in WAL \(Write-Ahead Logging\) mode for applications with <10k writes/second, single-node deployments, and low-latency requirements. Pair with Litestream for continuous backup to object storage \(S3\) and point-in-time recovery.
Journey Context:
The conventional wisdom that 'SQLite doesn't scale' ignores WAL mode, which allows concurrent reads during writes and significantly improves concurrency over rollback-journal mode. For small teams, eliminating the network hop to a separate database server reduces latency and operational complexity \(no connection pooling, no PG bouncer\). The critical limitation is that SQLite locks at the database level, not table or row level, so high write contention from multiple processes causes serialization. Litestream mitigates the disaster-recovery objection by asynchronously streaming WAL segments to S3, providing RPO \(Recovery Point Objective\) of seconds. This architecture is proven in production at Fly.io and by the Litestream author.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:45:38.313499+00:00— report_created — created