Ask HN: Why do web frameworks always use database?

https://news.ycombinator.com/item?id=880279
by prewett • 17 years ago
2 6 17 years ago

I'm designing an information-heavy web site (static content, no user content), and have been wondering the best way to do it. Drupal, django, RoR all get the information through a database. It seems to me like this has a number of problems:

* 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]

Related Stories

Loading related stories...

Source preview

news.ycombinator.com