Jump to content

EAV table design or not


peterbz

Recommended Posts

I have a CMS site about cars with categories such as wheels, auto parts, used cars, etc

 

I was wondering if I should have a EAV table design as the wheels, auto parts, used cars all have different attributes.  Now, each of the auto parts, cars, wheels, etc also have their own categories, which would mean that creating a single Categories table very efficient.  However, I just read the sticky on Anti MySQL Design Patterns and it frowns on EAV and insists on separating them into different tables, which would also mean separating the categoriy table into 3 or more (for each of the auto parts, wheels, used cars, etc).

 

Now I can see that having them in separate tables makes life a lot easier when retrieving data as the number of joins and detecting if it's a int, char, etc would be a nightmare.  However, having everything in a central table seems to be easier for searching and also easier to maintain if things ever needed to be moved around or change (also, other tables such as Images can easily reference items from a central table with one id).

 

This is why I'm very lost and don't know which design to use.  Can anyone please give me some advice?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.