I'm thinking to use EAV for some of the stuff in one of the projects, but all questions about it in stackoverflow end up to answers calling EAV an anti pattern.But I'm wondering, if is it that wrong in all cases? Let's say shop product entity, it has common features, like name, description, image, price, etc., that take part in logic many places and has (semi)unique features, like watch and beach ball would be described by completely different aspects. So I think EAV would fit for storing those (semi)unique features?All this is assuming, that for showing product list, it is enough info in product table (that means no EAV is involved) and just when showing one product/comparing up to 5 products/etc. data saved using EAV is used.I've seen such approach in Magento commerce and it is quite popular, so may be there are cases, when EAV is reasonable?
EAV - is it really bad in all scenarios?
database design;data structures;anti patterns
This is a good forum discussion on this very topic and good points are brought up on both sides of the argument.http://www.dbforums.com/database-concepts-design/1619660-otlt-eav-design-why-do-people-hate.htmlEAV gives a flexibility to the developer to define the schema as needed and this is good in some circumstances.On the other hand it performs very poorly in the case of an ill-defined query and can support other bad practices.In other words, EAV gives you enough rope to hang yourself and in this industry, things should be designed to the lowest level of complexity because the guy replacing you on the project will likely be an idiot.