One Binary, One SQLite File: Boring Architecture That Scales Further Than You Think
Why removing network hops, external caches, and container orchestration often produces lower latency and simpler operations than distributed stacks.
Most web performance bottlenecks are self-inflicted. Before an application serves a thousand daily users, it already sits behind a separate API gateway, an ORM, a managed database over TCP, a Redis cluster, and three build pipelines.
Every layer adds latency, failure modes, and operational tax.
Latency is mostly network hops
Consider what happens on a typical dynamic request in a split architecture:
- Browser hits edge proxy.
- Server parses session by calling Redis over the network.
- ORM builds a query and sends it over TCP + TLS to a managed Postgres instance.
- App serializes JSON, sends it to an SSR process, and streams HTML back.
Now compare that with a single-process monolith backed by embedded SQLite in WAL (Write-Ahead Logging) mode:
- Session lookups and primary queries happen in-process via local file I/O and OS page cache—measured in microseconds, not milliseconds.
- Eliminating serialization boundaries between backend and frontend lets you render HTML directly (via server templates or in-process SSR) with predictable tail latency.
Tuning SQLite for web workloads
SQLite works remarkably well for read-heavy and moderate-write web apps when configured explicitly at startup:
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA foreign_keys = ON;
Two rules keep SQLite trouble-free:
- Enable WAL mode and
busy_timeout. Readers do not block writers, and brief write contention waits cleanly instead of throwingSQLITE_BUSYimmediately. - Keep write transactions short. Never hold a SQLite write transaction open while waiting on an external HTTP call or email provider.
Operational simplicity is a performance feature
When your entire application is one compiled binary (fondasi, fondasi-rust) or one Bun process (dulak) plus one .db file:
- Deploys are atomic swaps (measured around ~0.27s on a single VPS with zero server-side toolchain).
- Backups are copying one consistent snapshot, not coordinating multi-service dumps.
- Debugging at 2 AM means checking one process and
journalctl—not tracing logs across five containers.
Start simple. Only pay the complexity tax of distributed infrastructure when real measurements prove you have outgrown a single machine.