Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Awkward database design

Author  Topic 

beba
Starting Member

2 Posts

Posted - 2004-09-23 : 07:01:28
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

11752 Posts

Posted - 2004-09-23 : 08:34:48
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

2 Posts

Posted - 2004-09-24 : 06:30:35
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

11752 Posts

Posted - 2004-09-24 : 07:23:29
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

145 Posts

Posted - 2004-10-12 : 03:57:25
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
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2004-10-12 : 07:33:51
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

1591 Posts

Posted - 2004-10-12 : 07:49:45
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

11752 Posts

Posted - 2004-10-12 : 09:17:05
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
   

- Advertisement -