ENGINEERING 155 upvotes 2024

How (and why) to run SQLite in production

155 pts
Hacker News Signal
2024 · Shared by @mooreds
How (and why) to run SQLite in production by @mooreds

Retrospective Overview & Key Insights

Distilled reflections, business mechanics, and tactical takeaways:

In this technical retrospective (2024), @mooreds shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.

Core Principles for Independent Builders:
1
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
2
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
3
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:

HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.

Community Discussions & Critical Reviews

Key perspectives, counter-arguments, and peer founder insights debated on Hacker News (80 total discussions):

AB @abbbi Peer Contributor
GL @Glench Peer Contributor
SK @skybrian Peer Contributor

I went through this presentation looking for "how do you do backups" and it glosses over it. But the author blogged about that separately [1].

It seems he uses Litestream with DigitalOcean Spaces for this. Looks like they start at $5 per month for 250 GB [2]. Would that be the best way for a hobbyist to get started?

[1] https://fractaledmind.github.io/2023/09/09/enhancing-rails-sqlite-setting-up-litestream/ ↗ [2] https://www.digitalocean.com/pricing/spaces-object-storage ↗

MY @mythz Peer Contributor

We're also defaulting to using SQLite first for our new Apps with Simplicity, Speed, Cost and flexibility being the motivating factors.

Not needing a managed database also allows us to move away from AWS onto much better value Hetzner servers, much love to Litestream [1] which makes replication to R2/S3 effortless. It's a silly 30-40x cheaper hosting SQLite Web Apps on Hetzner compared to the "recommended" managed DB configurations on AWS/Azure.

[1] https://docs.servicestack.net/ormlite/litestream ↗

HN @hnarn Peer Contributor
HISTORICAL ERA Post-ZIRP & AI (2023–2026)
COMMUNITY SCORE 155 points
TOTAL DISCUSSIONS 80 comments
TOPICS & TECH STACK:
More Retrospectives by @mooreds