SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Awkward database design
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

beba
Starting Member

Ireland
2 Posts

Posted - 09/23/2004 :  07:01:28  Show Profile  Send beba an AOL message  Send beba a Yahoo! Message  Reply with Quote
We are using an product that has very strange database design. All attributes of main entities of the system like customer, account, user etc are stored in one table like Attributes. Then, all main tables like Customer, Account, User etc are associated with the table Attributes via intermediary tables like Customer_Attr, Account_Attr, User_Attr etc. So, when you for example need to read value of Customer name you are supposed to make join of three relevant tables (Customer, Customer_Attr and Attributes) in order to get the information.


What can you say about this database design as it sounds really awkward. Is it Relational? If it is, I think it is not even in II Normal Form. What would be the reason to design database like this?

Thanks,
Danijela

spirit1
Cybernetic Yak Master

Slovenia
11645 Posts

Posted - 09/23/2004 :  08:34:48  Show Profile  Visit spirit1's Homepage  Reply with Quote
it even hurts my brain to think why someone would desing something like that....
there probably is a reason but i can't think of one.
this looks like overnormalization to me.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

beba
Starting Member

Ireland
2 Posts

Posted - 09/24/2004 :  06:30:35  Show Profile  Send beba an AOL message  Send beba a Yahoo! Message  Reply with Quote
Guys,

Meanwhile I found out what's that all about. The whole concept is named Meta Modelling – it is supposed to be very trendy these days. It is specifically used in case when one wants to be able to add new attributes to existing entities without the real alteration of existing tables (e.g. if you are not quite sure if list of attributes of any entity is finalised). You can easily add new ones and make the whole system breath dynamically.

Thanks,
Danijela
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11645 Posts

Posted - 09/24/2004 :  07:23:29  Show Profile  Visit spirit1's Homepage  Reply with Quote
nice to know...
can you please tell me an example of using this concept.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Joozh
Posting Yak Master

144 Posts

Posted - 10/12/2004 :  03:57:25  Show Profile  Reply with Quote
Hi beba,

The logic of companies developing products/solutions based on such database design approach is that this makes the design flexible and new requirements can easily be added without much code re-do. In my opinion there are pros and cons of this approach... Yes it does make the 'design' flexible but the development and query writing appraoch becomes complicated (as you have indicated). Also, I would assume that due to the database 'structure' the performance of queries would also be slow....

So the main beneficiary of this approach is actually the company who makes the product and not really (or as much) the client....

Hope this adds some useful thoughts to your post.

Thanks & Regards.

-J
Go to Top of Page

Wanderer
Flowing Fount of Yak Knowledge

United Kingdom
1167 Posts

Posted - 10/12/2004 :  07:33:51  Show Profile  Reply with Quote
Spirit, basically, it Extreme generalization saying that every entity is made up of attributes, and that "made up" is the relationshsip, and that attributes may be on several entites. so they build:


CUSTOMER ---<CUSTOMER_ATTRIBUTES>----ATTRIBUTES


and the Customer_attributes table effectively defines the table structure. To add a column, they either link another customer_atributes, if it is an existing attribute, or else define a new attribute, and then create the new link.

BEBA:

do they only have 3 tables:

Entity----<Entity_Attribute>-----Attribute

with data like:

TB_A       TB_A  COL_A           COL_A
TB_B       TB_A  COL_B           COL_B
           TB_A  COL_C           COL_C
           TB_B  COL_B           COL_D
           TB_B  COL_D


So if you wanted a new table TB_C, with column COL_A and COL_C and a new column COL_E, you would add COL_E to attributes table, TB_C to the Entitytable, then create the TB_C COL_A, TB_C COL_C and TB_C COL_E entries in the Entity_Atribute table.

At least, that's how I think it works...



*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

byrmol
Shed Building SQL Farmer

Australia
1591 Posts

Posted - 10/12/2004 :  07:49:45  Show Profile  Reply with Quote
Its also called the EAV (Entity Attribute Value) system.
Meta Modelling? Who made that shit up! Marketing departments.. Is there anything they can't do?

The reason its a nightmare is that there is no concept of type or domain.. way to leverage a database fellas...strings for all my friends...

DavidM

"Always pre-heat the oven"
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11645 Posts

Posted - 10/12/2004 :  09:17:05  Show Profile  Visit spirit1's Homepage  Reply with Quote
if you ask me that meta moddeling is preety close to useless...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.03