ENGINEERING 133 upvotes 2020

Scaling SQLite to 4M QPS on a Single Server (EC2 vs. Bare Metal)

133 pts
Hacker News Signal
2020 · Shared by @based2
Scaling SQLite to 4M QPS on a Single Server (EC2 vs. Bare Metal) by @based2

Retrospective Overview & Key Insights

Distilled reflections, business mechanics, and tactical takeaways:

In this technical retrospective (2020), @based2 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 (42 total discussions):

WA @watsocd Peer Contributor
BR @brandmeyer Peer Contributor

In the list of features which are somewhat custom to their use case, they listed "Disable POSIX advisory locks".

Turns out this is available stock right now as the "unix-none" VFS implementation. We're using it in an almost-but-not-quite-POSIX RTOS that happens to be missing advisory locks.

See also https://sqlite.org/vfs.html ↗

XW @xwdv Peer Contributor

I know people are itching to jump to the conclusion that bare metal is ultimately way cheaper than cloud, but really, it isn’t.

At the end of the day, we want operating expenses, not capital expenses.

And if you purchase a ton of bare metal and suddenly your business needs change it will not be easy or quick to move that much metal or install new metal in place.

Stick to the cloud.

NI @nijave Peer Contributor

They're comparing bare metal to a virtual machine here, aren't they? Of course I'd expect some pretty noticeable performance differences there. Not sure they were offered at the time of the post but AWS also has bare metal that seems like it'd but a much more fair comparison

Cloud VM vs on-prem bare metal doesn't seem like a very fair comparison

HISTORICAL ERA Pandemic Bubble (2020–2022)
COMMUNITY SCORE 133 points
TOTAL DISCUSSIONS 42 comments