If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > EAV or not to BE, that is the question? Please help me by voting?

View Poll Results: What should I use? or what would you use?
You should definitely the EAV Model 0 0%
You should definitely use Sub Type/Super Type Model 3 42.86%
You could use either, because.... 2 28.57%
Other, please explain... 1 14.29%
Gaj, I’m as baffled as you 1 14.29%
Voters: 7. You may not vote on this poll

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-08, 18:14
gaj gaj is offline
Registered User
 
Join Date: Jul 2004
Posts: 32
EAV or not to BE, that is the question? Please help me by voting?

Hi All,

I started a thread over here:

Modelling help

I've got a few options and I would like all you experts to tell me what you think I should do...

The problem:
I want to be able to store different types of information for products in different categories.

So Category A maybe TV's and category B maybe DVD players, I want to be able to store different types of information on each product in that category. So for TV I may want to store screen size etc.. and for DVD players I may want to store if it supports upscaling etc.

Obviously each piece of info will be of a different data type but the reason I ask how best to store this is because I will have lots of categories of products and the products will be used for filtering too. So I need to create a solution which is not too costly on performance.
Please vote on which method I should choose.

Thanks...
__________________
UK Gadget News and Reviews
Reply With Quote
  #2 (permalink)  
Old 03-17-08, 19:05
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Other.
Use the XML datatype, but only for the undefined elements.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 03-17-08, 19:09
gaj gaj is offline
Registered User
 
Join Date: Jul 2004
Posts: 32
sorry forgot to add that...
__________________
UK Gadget News and Reviews
Reply With Quote
  #4 (permalink)  
Old 03-18-08, 05:43
GWilliy GWilliy is offline
Registered User
 
Join Date: Jan 2003
Location: Nottinghamshire, UK
Posts: 364
As it stands today

If the the product types are going to be greater than 50, constantly changing AND this will always be an in-house system, I would actually consider EAV.
BUT
I would have to encapsulate ALL comunications with the EAV Product Object via Views, SP's, UDF's, Scheduled Data Integrity Checks etc.
All other tables would be 3NF.

Otherwise Sub Type / Super Type & Just accept the on-going DDL and DML maintainence cost (maybe using an SP to introduce a new Type and update views, generate DDL etc).

Now I'm gonna start investigating the XML Datatype as Blindman suggests
__________________
"Everything should be made as simple as possible, but not simpler." - Albert Einstein
"Everything should be made as complex as possible, so I look Cleverer." - Application Developer
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On