[Rails] SingleTableInheritance Considered Harmful

David Heinemeier Hansson david at loudthinking.com
Sat Nov 20 01:02:14 GMT 2004


> Let's keep in mind that good database normalization may or may not 
> equate to good database design. Normalization is an ideal, but in 
> practical application development, it is not always a good idea. 
> Mapping out inheritance structures in multiple tables can often lead 
> to large numbers of joins that can have a rather detrimental affect on 
> the database.

I agree. And let it be no secret that I consider the database a 
necessary evil for the object-oriented domain model. Not the other way 
around. Hence, when given the choice between implementations that pit 
OO model against database purity, I will almost always side with the OO 
model.
--
David Heinemeier Hansson,
http://www.basecamphq.com/   -- Web-based Project Management
http://www.rubyonrails.org/  -- Web-application framework for Ruby
http://macromates.com/       -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain



More information about the Rails mailing list