ENGINEERING ★ 133 upvotes 2020

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

Retrospective Overview & Key Insights

Distilled analysis of the business dynamics, operational challenges, and strategic 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

High-signal perspectives, counter-arguments, and peer founder insights debated on Hacker News (42 total discussions):

JU @justinclift Peer Contributor

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

WA @watsocd Peer Contributor

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.

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