Report #10292
[architecture] Selecting Postgres for read-heavy single-node applications with simple query patterns
Use SQLite in WAL \(Write-Ahead Logging\) mode for single-machine deployments with high read concurrency and infrequent writes. Configure: PRAGMA journal\_mode=WAL; PRAGMA synchronous=NORMAL. Accept the constraint: only one writer at a time per database file \(readers do not block\).
Journey Context:
Postgres IPC overhead \(process context switches, TCP/Unix socket latency, catalog locking\) dominates latency for simple key-value or index lookups on a single node. SQLite reads directly from memory-mapped pages in-process, achieving >1M reads/sec on commodity hardware with zero network overhead. The default DELETE journal mode forces exclusive locks during writes, blocking all readers; WAL mode implements snapshot isolation, allowing concurrent reads during writes via -wal shadow files. The critical tradeoff is writer concurrency: SQLite serializes writes at the database file level. If the workload requires many concurrent writers or network access from multiple hosts, Postgres is correct. For config stores, read-heavy APIs, or embedded analytics on a single server, WAL mode SQLite outperforms network databases operationally and in latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:17:21.905922+00:00— report_created — created