Ideas.  Dogtown.  Cape Ann, Massachusetts.

Database-backed Web Sites

by Philip Greenspun, updated March 1997

Note: this book was superseded in 1998 by a new edition

This is the free full-text electronic edition of what Macmillan published as Database-backed Web Sites

Note that the book was also produced by Hanser in a German translation by Olaf Borkner-Delcarlo

The Book

  1. Envisioning a site that won't be featured in
  2. So You Want to Join the World's Grubbiest Club: Internet Entrepreneurs -- how to make money off your site
  3. Learn to Program HTML in 21 Minutes -- there is no site so simple that a graphic designer can't make it slow and painful for users
  4. Adding Images to your Site
  5. Publicizing Your Site (without irritating everyone on the Net)
  6. So You Want to Run Your Own Server
  7. User tracking
  8. Java and Shockwave -- the <BLINK> tag writ large
  9. Sites that are really programs, CGI and API
  10. Sites That are really Databases
  11. Choosing a Relational Database
  12. Interfacing a Relational Database to the Web
  13. RDBMS-backed site case studies
  14. Sites That Don't Work (And How to Fix Them)
  15. A Future So Bright You'll Need to Wear Sunglasses

What was it like to write?

Magnolia biting Alex.  Massachusetts Institute of Technology. Originally I limited my comments to the words of Winston Churchill (1949, speaking at Britain's National Book Exhibition about his World War II memoirs):
"Writing a book is an adventure. To begin with, it is a toy and an amusement; then it becomes a mistress, and then it becomes a master, and then a tyrant. The last phase is that just as you are about to be reconciled to your servitude, you kill the monster, and fling him out to the public."
But I got so much email asking for more detail that I wrote The book behind the book behind the book....

A Paper Copy

Paper copies are available used from
Text and pictures copyright 1990-1997 Philip Greenspun. Most of the pictures are from
Mark Kelly, June 24, 1997
I think this book is great. It could be considered a great CS comedy classic (like Dilbert) as well as being informative.

-- Russ Tessier, September 13, 1997
Philip Greenspun's "Database Backed Web Sites" is an irreverent but informational and entertaining book that reads like a cross between a Dogbert management handbook and an O'Reilly manual. This book is completely unique to any technical manual I have ever read. It presents pertinent technical material in a way that is actually entertaining. This book is worth reading for any person interested in setting up a Web site (whether or not the site will include interactive database systems). It is particularly useful for technical personnel, but also contains enough high-level information to make it useful for less technical managers. This book is almost unique in the way that Mr. Greenspun gives his experience-based opinions on web tool and database manufacturers. No wishy-washy reviews exist in this book. Mr. Greenspun has case-reviewed his personal use of many of the more and less popular tools available today. Some of these reviews strongly suggest certain tools, other reviews strongly urge the reader not to use others. Mr. Greenspun is not afraid of offending manufacturers which have brought immature and ill-conceived products to market. This attribute is lacking in many of the technical magazines which exist today because the editors of these magazines cannot offend their advertisers. Because of Mr. Greenspun's different approach to tool review and his overall description of web technology, he has built an immensely informational book. I strongly suggest "Database Backed Web Sites".

-- Joe Nonneman, September 24, 1997
I've read your book Database Backed Web Sites and enjoyed it very much. It was the most entertaining technical book I've ever read. Come to think if it, it's the only technical book that I've ever read from cover to cover.

One of my favorite parts was the case study of your Remind Me system. It was simple enough to follow, yet "real world" enough provide useful examples -- not just another tutorial that has you write six pages of code in order to print "Hello world" on the screen.

-- J. Piscioneri, November 1, 1997

Database Backed Web Sites is the reality behind the hype! We have distributed this book throughout our organization because it not only gives details on Web publishing, but gives the reader a feel for the "social environment" of the Web. It is much more than a book about Web databases, although that is what is really driving Web development. Our managers as well as our technicians and programmers enjoyed the book because it is written in an enjoyable, humorous way. We not only use it as a reference, but we all find ourselves going back to read passages and compare our own experiences to incidents mentioned in the book. The only problem is the title. It doesn't really do justice to the wealth of information and enjoyment that any reader will experience.

-- Mark Samis, November 4, 1997
Summary: if you want to [understand how to] build robust, useful, attractive websites, this is the book for you.

There's much more to Greenspun's work than Dilbert/Dogbert's recycled truisms; don't compare them just because Greenspun's writing is witty and often very amusing. The difference is that Greenspun's book has *content*: real, useful, and very-well presented (and yes, the humor does help).

In a the Web's mediascape full of hype, punditry, and PR writing passing itself as technical content, Greenspun's book is welcome relief. This guy is a practical problem solver who retains the sense of technical elegance often confined to "academic" (not necessarily university!) environments. He tells us how to build production systems with existing technology, but he does not mince words about the dismal state-of-the-art.

The book covers from the nitty gritty but crucial detail of avoiding unix process forks to the clear but evidently (look around at the web) not obvious question of putting actual content on websites. That is, it not only covers the 'how', but also delves in the 'what' of web publishing, and profits from the understanding their synergy.

-- Cris Pedregal Martin, November 4, 1997

Excellent book. I hope some marketing people read it.

This book won't turn you into a DBA, nor will it give you all the technical skills needed to make a fancy web site with animation and other BS. What it will do is help you to build a web site that's actually useful. Unfortunately, this is sorely lacking out there on the web. Additionally, this book will teach you how to create a site that will attract both new and repeat readers.

Philip gets a lot of points for pushing technology that is appropriate to the task. A good web site needs content. This content must be both growing and searchable. Content = data so what's better at maintaining data than a database(it's sad how many people out there are using C and flat files for this purpose)?

I'd have given the book a full 10 but I'm taking away 1/2 point because Philip has spent a little too much time in academia. He loses another 1/2 point because he and his fellow CS people at MIT couldn't get a printer to work with NT(I've built PC's out of spare parts and gotten NT to work reliably without a lot of effort, and I went to UMass).

-- Paul Wilson, November 4, 1997

If you buy one book on the web this year and you already know HTML, make this book the one, because you're not going to learn anything from the other ones anyway.

The quote you're looking for is "Why are they coming to your site? If you look at most Web sites, you'd presume that the answer is 'User is extremely bored and wishes to stare at a blank screen for several minutes while a flashing icon loads, then stare at the flashing icon for a few more minutes.'"

The book should really be called something like "Building Web Sites: How To Avoid Wasting Money". Clear ideas, no stupid hype, engaging writing. You may disagree with the concepts, but it's worth reading just to see what he has to say.

This text includes a "brain turned on" discussion of just about everything dumb in the web, from four page entrance tunnels to goofy multimedia presentations, to annoying interactive GIFs, to David Siegel. It doesn't tell you how much money you'll make putting up your dumb personal site, and is heavy enough to act as an "authoritative reference" in the general direction of managers that ask for stupid additions to the company site. Sure, you probably don't need a book to tell you all this - just a brain - but it's a fun read and you can look like you're engaging in "professional development" at work. See if you can get them to pay for it.

There's also a lot of discussion about how to interface a web server with a database. It's good, but it's not what makes this book great.

Added bonus: the best diagrams I've ever seen in a computer book, drawn on napkins. The lack of transition to goofy line art made them a lot easier to read.

The text, along with comments on the writing of the book, are available online at but I recommend just reading his comments and then buying the hardcopy. For one thing, you can read it anywhere rather than driving yourself blind reading a one inch thick book on your computer monitor. For another, you can hit people with it. This is one of the key qualities for a good web product, and the paper weight here really delivers. Sure, you could probably print out the entire web site and do the same with that, but the pages would fly everywhere afterwards.

I'd like to think that sending money in the direction of books like this would cause the industry book quality to improve as well, but my experience in the computer book publishing industry (whose marketing plan most closely resembles dumping the cesspool on the audience and hoping everyone gets wet) tells me otherwise. At least give your money to Greenspun, who deserves it for writing such a good book (and pukey green color, too!).

-- Faisal Jawdat, November 5, 1997

Irreverent and invaluable...don't leave your homepage without it. Philip Greenspun is absolutely your best guide to the RDBMS-web frontier.

-- Teresa Ehling, November 5, 1997
I knew what a database was before I read the book. I think that was all. Now I manage a student (a sophomore) who handles our Multi-University Research Initiative Relational Database-backed web site. It's not all Greenspun's input--but like 90% of the wisdom came from Greenspun's book. I bought all his suggestions (mostly because he justified them), and they all panned out. Get AOLserver, get Solid, spend lots of time on the data modeling, don't write anything in C, don't fork a cgi process every time you want to query the database--hang the database off the server... This could get long quickly. All I know (almost) about databases, I learned from Greenspun. But don't get me wrong; if you're an idiot, you won't appreciate the book--so don't buy it.

-- John Kaufhold, November 14, 1997
The best general book on web publishing I have seen yet.

A 900 word review can be found at

-- Danny Yee, November 16, 1997

Many books purport to teach people how to use the unique and or functional features of various products. Greenspun is honest enough to tell us what doesn't work.

Especially in the fusion of web and database, where product specific overtechnical and underedited tomes teach people to build marginally useful sites handling hundreds of hits per day, Phil has given us a philosophy for designing much bigger, much more useful sites. It's an added bonus that the ideas are expressed clearly enough that they are readable by less technical management, who often believe that if they spend enough money on industry leading products, everything will work wonderfully.

-- Cam MacKinnon, November 17, 1997

There are a lot of choices when it comes to database site development, but "Database backed Web sites" really helped me to separate the advertising hype from the reality, and also provided invaluable historical background for anyone who wants to get a grasp on where software development has been and where it's going. The book was also well seasoned with experienced based cynicism, that made me laugh while I learned the side of the story that the software companies don't want you to know.

-- Godfrey Alleyne, November 20, 1997
While there are many things to love about this book, I think the best part is that Philip places the emphasis on putting yourself in the user's shoes. He avoids the narrow focus of the "Teach Yourself To Be A Dummy In 21 Days" books. He talks about the why's as well as the how's. And he's funny as hell. I love this book!

-- David A. Buser, November 20, 1997
This book will increase your cool nerd status if you recomend it to others.

It provides many useful insights into web page/server design. It clearly and concisely puts into words arguments for good web design. A friend of mine surfed the web site, went into a meeting, and promptly shot down (with a cogent reason) why his company did not need a "tunnel" at the beginning of the web site. Prior to surfing the site, my friend just knew tunnels were wrong, but he had no argument why. After the meeting, he ordered the book (yes this story sounds like a chain letter).

The book advances strong reasons why coding is wrong when off the shelf tools will serve just as well.

For anyone who has built a huge mission critical system starting from "hello_world.c", a CORBA grid or banking example, or MicroSoft's "generic.c", scribble tutorial, or a sample app (you know who you are), this book provides the starting base for building a robust web enabled database application. Many projects map nicely to this solution; in fact, the book demonstrates several different applications. By shamelessly stealing Greenspun's ideas and work, one can look wise and deliver working code faster then one's experience would permit ordinarily. Truly what the web is about.

-- albert s boyers, November 21, 1997

Elegant. Concise. Opinionated, offensive. Muhammad Ali takes on web publishing. This book does a very good job of explaining why there is no single approach to web publishing. Most books out there tell you how to "Publish in the Web using (insert your favorite platform here)" Philip Greenspun is the first author to come up with an articulated methodology to build web sites that add information value, and he does it by covering a myriad of different tools and explaining why and in which context they work. Although I do not agree with everything in the book (especially the author's claim that LISP is the best programming language ever), no design decision is made without a convincing explanation. Although the design philosophy fluff is pretty good by itself, he has also included enough code so that you can understand how the innards of web information systems work. Must-read for anybody who needs to do anything dealing with databases and the web.

-- Joao Paulo Aumond, December 12, 1997
There is seemingly an endless supply of books about 'The Web', so it's hard to get excited about any one in particular. Philip Greenspun's "Database Backed Web Sites: the thinking person's guide to web publishing", on the other hand, is very good.

As opposed to being a compendium of HTML tags and pre-made home pages "so you can be online tonight!", the book's aim is to make the reader aware that there's more to the web than cute Java scripts and silly animated GIFs.

The main idea is that a static web site resembles a coffee table book with pretty pictures: you look at it once or twice, then it's just taking space.

Philip explains how to create web sites with databases behind them to manage the content, provide interactive discussion forums where the users provide a lot of the content, and help analyze the server logs to see what your users are doing while visiting your web site.

Instead of the step-by-step approach, teaching is done by case studies, which I consider a preferrable approach, since it makes the reader think and forces understanding before something can be produced.

There's plenty of light humor throughout the book, without getting too silly or distracting from the main purpose. And the book doesn't come with a CD. This is actually a good thing, since the author makes what would be on a CD available on the Internet via FTP servers. This has the advantage that the material can be updated over time.

The book includes a light discussion of Internet connectivity options, as well as a somewhat detailed description of the web server software and operating systems in use. While not complete (VMS, for example, is not mentioned), it's impossible to be current while publishing a book. Even a monthly magazine is out of date before it hits the stand.

In sum, definitely recommended reading.

-- Javier Henderson, December 18, 1997

Very unique book. Presents viewpoints that one has to look very hard to find nowadays: accurate, not sugar-coated, and honest.

The most useful *concept* in the book is that sticking to standards is good; a site that looks great but is all line breaks and font tags is a (mostly) useless site.

The most useful *tool* (for me) was actually learning how a relational database works; they're a lot simpler than one would think. I've often heard of them but not even bothered to find out more because they seemed overkill for the task.

Also, AOLserver is the last thing I would have used, it being owned by the same people who brought us America Online, but it's really the best tool I've seen for the job if you really want to put up an online database; only problem I have with it is that I've not taken the time to learn some of the more advanced configuration syntax, which isn't the server's fault.

Which brings me to the third most useful toolset, Lisp and MetaHTML. (Including them together because MH is largely inspired by the former). Lisp is another thing I'd heard about but thought was the wrong tool or overkill. It's really one of the easiest languages I've seen to learn, and certainly the most elegant.

-- Gavin Lewis, January 3, 1998

I can't think of anyone in the web industry -- engineers, content producers, advertising sales, etc. -- that wouldn't benefit from the remarkably common-sensical (yet somehow lucidly revealing) presentation that Greenspun's spun.

The only problem is that the title makes it look like a techie book -- one for database techies. There is plenty of that covered, but for me (a non-database techie) there's so many gems sprikled throughout that I recommend it to anyone, techie or not.

I spent 2.5 years writing a book of my own, yet I feel this is one of the best books I've ever read. The only problem I could point out, besides the ill-conceived title, is that some of Greenspun's nomenclature gets overused and somewhat weary. A small price to pay for the fantastic light he sheds on common-sense web publishing.

-- Jeffrey Friedl, January 14, 1998

Overall a great "in the trenches" overview of web database design... almost as good as this web site! I was looking for nuts and bolts about choosing servers, database engines, scripting languages, and I wasn't disappointed (tho I wish I had more programming background to feel like I was *realy* understanding all the important points!). What the book gave me that I wasn't expecting was (1) valuable perspectives on what makes a site good, what makes a site worth even doing (2) no punches pulled skewering of both hardware and software companies for design flaws, bad customer service, and other sins (3) Really funny anecdotes and wicked sarcasm... I was laughing out loud several times just reading it to myself. A really good book, no complaints.

-- Dan Doernberg, January 22, 1998
It's a good book; it may even be a great book.

It's an introductory book about a a single subject (hooking a database into a web server) that frequently wanders outside the alloted subject into related matters (what makes a web site good, how to administer a web site).

It is a practical manual (any programmer who reads this book will have a solid grasp of the subject and will be ready to go out and hook databases to web servers with elan) without having much in the way of code or boilerplate recipes and without being product specific.

It's written from experience-- there are lots of warnings, lots of examples drawn from real projects, lots of information about avoiding pitfalls. And yet, it's short, pithy, and an easy read.

In short, it's a roadmap to the technology, covering the obvious important issues (CGI scripts, connecting to databases) and the ones that are important, but that a first-timer might easily overlook (for example, Chapter 7: Learning from Server Logs. 20 pages that explain what logs do and why they're useful. Good info, nicely presented).

-- William Grosso, January 31, 1998

Database Backed Web Sites is excellent. The first publication I've read that helps me understand why someone would visit a Web site, and how to optimize the design of your site to deliver value to the users. For a non-technical hoping to improve, this book gave me the "why", not just the "how" or "what".

-- Kenneth J. Cook, February 13, 1998
What can I say that hasn't been said? You succeeded in presenting your topic outside of the realm of marketing hype. Yet, you maintained a keen sense of wit and irreverance throughout the book.

-- John Zachary, March 13, 1998
Those of you who really want a copy of Philip's previous book in German have probably been frustrated. The publisher broke the link -- how annoying:
Fehler 404 Leider konnte die angeforderte Seite auf unserem Server nicht gefunden werden.
Fortunately, a quick search reveals that they still carry Datenbankgest|tzte Web-Sites in their current catalog.

The Idea Factory is out of print, at least according to Amazon.

-- Frank Wortner, October 21, 1999

I remember the first time i tasted phillips semen when he was a little boy. This book does a good job of not talking too much about that. In fact it's about computers or something.

-- bucket haus, February 21, 2002
You have no right to criticize anyone by the looks of your website. I would be careful about following rules in the future. It my bite you where the sun don't shine. Oh yea, you should remove this useless website. no one cares about it and you are wasting valuable internet bandwidth.

-- waldo kipper, May 10, 2002
Add a comment

Related Links

Add a link