Supporting Data Integrity
Let's understand the downside of using the EAV database design in detail.
We'll cover the following...
We'll cover the following...
When we use EAV, we sacrifice many advantages that a conventional database design would have given us.
We can’t make mandatory attributes
Returning to the example stated above, to should also require that the date_reported attribute has a value. In a conventional database design, it would be simple to enforce a mandatory column by declaring the column NOT NULL.
In the EAV design, each attribute corresponds to a row in the IssueAttributes table, not a column. You would need a constraint that checks that a row exists for each issue_id value, and the row must have the string date_reported in its attr_name column.
However, SQL doesn’t support a constraint that can do this. So, you must write the ...