NYCPHP Meetup

NYPHP.org

[nycphp-talk] table structure for "friend" relationships

Hans Zaunere lists at zaunere.com
Fri Jul 31 10:20:53 EDT 2009


All,

> > I'm thinking the multi-table joins performed twice for each search
> > will make more of a hit in performance (and maintenance) than
> > writing two rows for each relationship and then always being able to
> > search only once.
> 
> I've used code like that successfully for 4 years. I'm not sure if
> that's even technically denormalization, but the savings in read time
> definitely outweigh the extra writes and storage.

In many modern web application, relational pedantic have been fading.
Denormalization is often a good thing, and very large sites are in fact
highly denormalized.  This is due to the type of data they need to store
(friend relationships is a classic one), and the level of throughput they
need to achieve.

The importance of transactions faded when MySQL become the dominant database
on the web, and now even relationships are fading (sounds like a soap opera,
I know).

Instead, things like document based DBs and memcached is where it's at.  The
goal really is key/value pairs with insane performance because there's no
overhead to manage that "old clunky SQL" - in fact, these are often
considered schemaless databases.

We have a couple of presentations coming up about this in the fall - check
out the calendar on www.nyphp.org

Some useful links:

http://en.wikipedia.org/wiki/Document-oriented_database
http://labs.google.com/papers/bigtable.html
http://aws.amazon.com/simpledb/


"The times they are a changing..."
   (yet somehow that phrase always hangs on :)

H






More information about the talk mailing list