Home Forums Database Design Design Ideas and Questions Pros and Cons - Table with loads of uniqe columns VS Row based keys with row data type RE: Pros and Cons - Table with loads of uniqe columns VS Row based keys with row data type

  • iBar (8/2/2012)


    opc.three (8/1/2012)


    The EAV model is an anti-pattern when attempts are made to apply it as a 'more flexible' replacement to a proper relational design. There are certainly places where it shines, for example in modleing sparse attributes, but they are niche.

    This article, and moreso the ensuing comments, parses the issue apart quite well:

    Keeping It Simple > EAV Fail

    hi opc.three,

    Only thing which is missing from your provided link is "EDT_data_type" e.g. Date, Num, String - which is certainly missing from the example in your provided link.

    Can data_type column and respective views on top solve this issue?

    Thanks

    The article's author is explaining why he believes we should not use EAV for much of anything. Your question about data types is one of the primary reasons supporting that position. So yes, you can workaround the issue with views, triggers and complicated constraints but you'd be reimplementing something the DB engine provides for free when using a proper relational design.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato