NYCPHP Meetup

NYPHP.org

[nycphp-talk] data modelling vs. db design (was: ER Diagram tool for MySQL/OS X)

Stephen Musgrave stephen at musgrave.org
Tue Oct 4 11:07:53 EDT 2005


On Oct 4, 2005, at 8:06 AM, Phil Duffy wrote:

>> Can anyone suggest reasons why it's better to have fewer tables, or to
>> try and combine different types of objects into the same table?  
>> Surely
>> it's something to do with better performance (fewer joins, simpler
>> queries), right?  Is this a common principle of design that I haven't
>> learned yet?
>
> The rule I used in the development of a framework was (1) model the 
> real
> world first, and (2) de-normalize only when it is obviously necessary 
> for
> performance reasons.  I can't say that I ever read that anywhere, but 
> I am
> sure it is not original.

This is an interesting topic because I'm approaching a question based 
upon this principal.  There is an application that I am building where 
the User record can have 5 addresses (home address, work address, 
permanent address, international address, etc, etc).  I'm considering 
making a table called UserAddress and then linking it to address ID 
fields in the User table.  I'm on the fence about it because while I 
don't want a monstrous User table with tons of columns, I also don't 
want to over normalize.

Thanks,

Stephen

…………………………………………………………………………………
	email:	stephen at musgrave.org
	web:		http://stephen.musgrave.org/career
	office:  	 917.721.3378



More information about the talk mailing list