Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> One table or many - need valid reasons.
I need some assistance convincing the design group at my company of the
proper database design. I believe option 2 (below) is best. Your
collective feedback is appreciated.
Our new front-end CRM application is being integrated with multiple "back-end" systems. Each of these back-end systems has data that is common to all back-end systems and other data that is unique to the back-end system.
Our database model contains a single table for each common entity (i.e. customer, address, salesperson, etc.). There are a finite number of these common entitities (5-10).
Store data that is specific to the back-end system in a generic fashion so that when another back-end system is integrated, minimal database changes need to be made. For example, if one of the back-end systems contains a "smoking preference" attribute for a customer, rather than creating a new column in the customer table to store the smoking preference, a new record would be added to store the information in a generic "INTEGRATION_ATTRIBUTE" table.
There are two options being considered:
Create a ***single*** child table (i.e. INTEGRATION_ATTRIBUTES) with an ID and "type" column. Then, depending upon the type, the record would refer to a row in a specific parent table.
Create insert and update triggers on the child table to ensure that there is a row in the parent table, determined by the value in the "type" column, sharing the ID. (A pseudo foreign key.)
Create a delete trigger to ensure that if a row is deleted in the parent table all rows in the child table sharing the parent's ID are also deleted (A pseudo cascading foreign key.)
Create a child table for each parent table (i.e. CUSTOMER_ATTRIBUTES, SALESPERSON_ATTRIBUTES, etc.). Create normal cascading foreign keys between the child table and its parent.
Here are the advantages I've enumerated for option 2, are there others and are these accurate?
Thanks. Received on Mon Feb 07 2005 - 15:00:11 CST