Ruby on Rails Thursday, September 30, 2010

Well its the primary nature of the site. So expect to have tons of
media types. Initially, I thought separating them would keep the
tables smaller since each media type has its own table.

Someone mentioned that having it as an STI is fine. Like any other app
that becomes huge, we can always optimize?

On Sep 30, 8:29 pm, Michael Pavling <pavl...@gmail.com> wrote:
> On 30 September 2010 13:17, Christian Fazzini
>
> <christian.fazz...@gmail.com> wrote:
> > Ive got 3 types of media. Event, photo and video.
>
> > Most of these share common columns (title, description, etc). I am
> > thinking of creating a 4th model called media. And then event, photo
> > and video will inherit from media, making media an STI.
>
> > Is this a good approach?
>
> It is an option - for me, it would depend on how much other, different
> data each model has.
> Your structure may also suit a polymorphic approach - so that Event,
> Photo, and Video all have a "Media" association for the common fields.
>
> > I am worried that since all submissions are going into one table (the
> > media table). Some db performance issues may arise?
>
> How many Media do you plan to have?... what sort of problems do you
> anticipate that you wouldn't have with separate tables?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment