AnsweredAssumed Answered

Should I Use an EAV (Entity-Attribute-Value) Model?

Question asked by velaramon on May 10, 2017
Latest reply on May 11, 2017 by beverly

I'd appreciate some advice about whether an EAV approach is a good idea in the following situation.

 

My solution has an assets  Main Table with a large number of fields.  There are many fields because there are many attributes.  For instance, the table has the following fields for each asset:

 

     Asset_ID     Asset_Creation_Date     Asset_Status     Etc.

 

Over time, any record in the Main Table may change as a result of various events.  Each of those events has event-specific features that need to be tracked.  But as just stated, each event also modifies a record in the Main Table.

 

My thinking is that EAV may be the right way to structure the relation between the Main Table and the events table(s).  In particular, the events would be tracked with at least two tables.  One would have one record per event and the event-specific fields such as:

 

     Event_ID     Date     Doc_Container     Etc.

 

The other table would have one or more records per event with the following fields:

 

     Mod_ID     Event_ID     Main_Table_Field_Name     Main_Table_Field_Value

 

Then I would have a button-script to update the Main Table after an event's data has been entered in the events tables.

 

From what I've read, this approach sounds like an entity-attribute-value (EAV) model, which seems to be generally regarded as bad design.  Hence my question about whether this is the right approach.

 

Any insight appreciated!

Outcomes