There’s a flurry of conversation among those who build and host blogs on the subject of “baking”, i.e. causing your blog’s pages to be served using of ordinary “static” files stored on disk, as opposed to assembled at request time with calls to a database. Brent Simmons is sort of driving; see A plea for baked weblogs and More on baked blogs.
First, a couple of add-on technical points:
Serving pages out of flat files is even better than you think it is, because when the load gets heavy, your operating system tends to cache these pages in memory, and so if a page is getting requested steadily, the disks may not be involved at all.
This site, which runs on a perfectly ordinary mid-range Linux server shared with several other applications, can soak up a heavy simultaneous flow from Hacker News and Reddit and Daring Fireball and Slashdot without even breathing hard.
How I Do It · The way this blog is baked is bone-crushingly simple; not all that flexible but very lightweight, and has served me well. Maybe some variation of it will be useful for others.
There’s a Magic Number, and that number is 20. The 20 most recent pieces (excluding “Short-form fragment” Twitter roll-ups) appear in the Atom feed and are eligible for commenting.
The site is republished automatically every eleven minutes or so by a cron job. “Republishing” means going through the Magic 20 and checking, for each, whether the source has been updated, or one of the pictures has been refreshed, or whether new comments have arrived. There’s a dorky little MySQL database to make this easier.
If any of these changes have happened, the piece in question has its static form rebuilt; this includes splicing any assembled comments onto the end of the article.