# Active Record attributes (has\_many vs serialization vs sti)

**URL:** <https://www.ruby-forum.com/t/active-record-attributes-has-many-vs-serialization-vs-sti/131408>\
**Category:** Rails\
**Created:** [March 9, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/active-record-attributes-has-many-vs-serialization-vs-sti/131408 "2008-03-09T16:00:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [March 9, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/active-record-attributes-has-many-vs-serialization-vs-sti/131408/1 "2008-03-09T16:00:54Z")

</div>

I have a set of STI models, each have slightly different attributes.  
While I could create a row for each one, I feel that there may be too  
much null data in the database. At the moment I setup a has\_many to a  
parameters table which stores key value pairs. I want to find the best  
solution for performance and simplicity.

1. STI for each field (I think new fields will be needed more than not,  
and will require a lot of migrations)

2. Parameters has\_many association. Seems like overkill, not sure if I  
am getting a performance hit here.

3. Serialize params via YAML or Marshal

Any recommendations? Performance is primary concern, simplicity second.
