Report #6455
[architecture] Choosing between SQLite and Postgres for production microservices
Use SQLite in WAL \(Write-Ahead Logging\) mode with appropriate busy\_timeout \(e.g., 5000ms\) for read-heavy, single-node, edge-deployed services where connection pool overhead exceeds query latency; default to Postgres for multi-writer or networked scenarios.
Journey Context:
Teams default to Postgres due to familiarity, but for read-heavy, single-tenant services \(especially edge deployments\), SQLite eliminates network hops and connection pool complexity. The critical mistakes are: \(1\) using default DELETE journal mode instead of WAL, which blocks readers during writes, \(2\) not setting busy\_timeout, causing immediate SQLITE\_BUSY errors under concurrent write load, and \(3\) attempting multi-node replication \(SQLite is not built for this\). The sweet spot is single-node, high-read, low-write services where WAL mode allows concurrent readers during writes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:10:21.856729+00:00— report_created — created