Ask HN: Why do web frameworks always use database?
* All those database lookups are going to be slow
* All your data is locked up in a binary file
* How do you update your site? It doesn't seem like you can easily merge two databases, or update just the change deltas.
Instead, if all the content lives in separate files with other files telling how to put it together, then you can use a compiler (of sorts) to generate the site as a bunch of static pages for the site. The advantages would seem to be:
* Fast to serve content
* Easy to redesign (edit files, re-run `make` on the static pages)
* Easy to update the server: cvs update -d -P; make
* If there is user content, CGI could add files (assuming availability of locking). Then a backup would be as simple as `cvs commit`.
* Rolling back after an update gone bad would be easy.
The drawbacks seem to be minimal:
* Requires extra disk space (cheap)
* CPU-intensive to change site layout (infrequent)
* CPU-intensive to add content (presumably rarer than reading content, which is fast)
So am I missing something? Why are databases so popular, given that they seem to be slower, and harder to update/backup?
[Edit: slightly better formatting]