I'm doing some custom work with Magento, which has a database design based upon the EAV model, and I need some good resources/tutorials that explain the EAV database model. Please don't provide Wikipedia as a resource... I'm looking for something that teaches EAV in a friendly way for beginners.
-
1so what resources have you found that you didn't like, so we don't repeat your research - assuming that you did some research... – Steven A. Lowe Jan 30 '09 at 22:32
7 Answers
Here you go. An illustrative story: http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/

- 51,479
- 8
- 68
- 96
-
1how is this horror story even remotely related to the question? – Steven A. Lowe Jul 28 '09 at 15:30
-
2Um ... bcause it describes the real-world implementation of an EAV-based system from the pov of someone who was there, and the entirely predictable consequences of that design choice. – David Aldridge Jul 28 '09 at 23:22
-
2It is relevant to the original question. The answer to using Magento is Joe's whiteboard message, "Run Like Hell!" – Bill Karwin Aug 06 '09 at 16:24
-
3The EAV model is a slippery slope. It can work fine in a small tightly-scoped database, but blows up in your face the nearer you get to a production system. Use it as a prototyping tool to iterate the database design, but don't even think about building the system for real. Bad Carma is so close to my own experiences that it makes my flesh creep. My own take on EAV is here http://www.simple-talk.com/community/blogs/philfactor/archive/2008/05/29/56525.aspx – Phil Factor Oct 10 '10 at 14:00
The friendliest thing you can do for a beginner is to teach them the down side of EAV.
The up side of EAV is so seductive that a lot of newbies will dig a very big hole for themselves before they realize it.
Hopefully the google search will reveal at least some of the down side.

- 18,205
- 2
- 28
- 58
In a nutshell, EAV is optimized for getting data in, not getting data out. But that might be an acceptable trade-off. I managed a project that had to develop a general clinical trial data management system. There could not be many common data elements because each trial needs to collect different data. Capturing data was urgent; we had to develop data entry pages under pressure. Reports are harder with EAV, but they're also less urgent, and with some clever thought they can be simplified a bit. EAV has served us well.

- 29,517
- 10
- 67
- 94
-
Good point. Put another way, you can put data in without doing data analysis. But you have to analyze the data when you want to get data out, unless you are happy with nonsense. – Walter Mitty Jun 30 '16 at 13:01
I found this article really helpful, it provides considerations and consequences associated with an EAV schema and to provide a basic framework for its implementation in SQL Server.

- 61
- 6
I found this guide to be the most helpful for Magento: http://alanstorm.com/magento_advanced_orm_entity_attribute_value_part_1

- 2,959
- 2
- 17
- 21
You should check this article: The EAV/CR Model of Data Representation.
It describes EAV with Classes and Relationships, a more OO approach and not just a plain reference-key-value implementation.

- 344
- 1
- 10
See Dinua V, and Nadkarnia P. Guidelines for the Effective Use of Entity-Attribute-Value Modeling for Biomedical Databases. Int J Med Inform. 2007 ; 76: 769–779. http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=2110957