Scaling SQLite to 4M QPS on a Single Server (EC2 vs. Bare Metal)
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:
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
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.
CATEGORY Frugal Engineering →
HISTORICAL ERA Pandemic Bubble (2020–2022)
COMMUNITY SCORE ★ 133 points
TOTAL DISCUSSIONS 42 comments
Title should probably say "(2018)".
Also, it's already been submitted a bunch of times:
https://news.ycombinator.com/item?id=23070888
https://news.ycombinator.com/item?id=22856746
https://news.ycombinator.com/item?id=20778477
https://news.ycombinator.com/item?id=16118776
It's not just the server cost that matters when you compare the cloud to a bare-metal server.
What about:
``` Networking equipment Backup power - UPS and generators Internet backbone - Speed as well as reliability Cooling and other infrastructure costs
``` Then there is capital lock in risk. Once you buy the above hardware, you are probably stuck with it for a few years.
If you have stable load now for 25 big bare-metal servers, it may be cheaper to go bare metal. Otherwise, there is a lot more involved in the decision than going to dell.com and pricing a server.
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
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.
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