Computers are stupidly fast at serving out of RAM - it's not unusual to be able to serve 100K requests/sec if a request never needs to touch disk (see eg. the JSON serialization test on the TechEmpower benchmarks, on physical hardware [2] - top frameworks can get 500K request/sec on a hello-world serialization task). They're also stupidly fast at serving static files (which, if the server is implemented right, can be served straight out of the filesystem cache in the kernel without any memory copies through user space). 100K requests/sec is a budget of 20,000 cycles/request, which is eminently doable if most of the page contents is in RAM (or better yet, cache...on a slow day, the entire front page of HN can fit in L3 cache).
The same approach has been used to good effect on other websites like Google, Facebook, PlentyOfFish, Mailinator, etc. Eschew databases, serve out of RAM (and now SSDs) entirely.
[1] https://news.ycombinator.com/item?id=8863
[2] https://www.techempower.com/benchmarks/#section=data-r14&hw=...