When I hit industry, I was thrown in the deep end trying to keep high
traffic database backed websites up, the first thing i learned was
that joins were evil. In fact, anything that wasn't just a single
record pull by id from an indexed field hurt.
So we learned to have a normalised edit database, and a fully
denormalised published database that had a record for each page we
were serving. Yes this meant our published database was several orders
of magnitude larger than our edit database. But it was fast. And
that's all that counted.
So, by now, a decade later, I look at a fully normalised database, and
remember the fresh faced uni grads who brought our website down by
adding a small chunk to our main page that required six joins to
render. From memory at least one of those joins required a full table
Think of it as a space time trade off. We burn disk space to optimise
web page rendering time. When disks are cheap and page rendering time
Even though i attended uni, I spent more time arguing with lecturers
than actually learning course material. Something about having started
programming under my dad's tutelage at age 4. I have programmed
everything from vz200s in basic through to AS/400s in RPG/400. And
that was before i wound up at uni, beating up on Haskell. Oh what
But yeah. At the end of the day, it's all about understanding why
things are. Fully normalised databases make sense when you have a
reasonably high ratio of writes to reads. This makes sense because
normalised databases are optimised for the write case. Those of us who
really are self taught learn that emotional beliefs really doesn't
have a place when you are fighting with a cpu =)
> worst I've seen was a regular expression that was used to search
> through text blogs, once for each word in the search term and then in
> every possible combination of order, done with a php loop tossing out
> queries as fast as it could go.
I think i need a strong drink now...
Hopefully we will get some good tutorials up soon...
How about one entry with all the author names, and one entry with all
the comments in a thread.
This way rendering a comment thread would pull back two entries, and
as the thread is rendered, you can print out each author name as
Does that work?
I'm trying to get some sleep in before i do a production change on
some machines in five hours, so yeah, not fully rational at the
moment. Hah. Me rational. I'm a joke a minute.