What's wrong with EAV solution for an online store?

0 like 0 dislike
40 views
Faced with the problem when there are different types of goods (clothing and televisions have enough of the same parameters). I see 3 solutions to the problem
  • Serialized LOB is the easiest, but there is no search
  • EAV is not a complicated implementation, there is no problem in updating the database. In General, like that. But THERE write that is not very good.
  • Well, the most complex and expensive (in time) variant of the separation of goods into different tables



Actually any thoughts? How to make convenient for me as a programmer to redo everything and that people were comfortable?
by | 40 views

3 Answers

0 like 0 dislike
Most bugs listed on stackoverflow, patched, well-built business logic. This can be seen in the example of Magento.
\r
The only thing to note — when migrating to EAV you need to evaluate whether the game is worth the candle.
\r
If the structure of the categories and/or types of goods is relatively constant and rarely changes, it makes sense to use flat tables (what you have specified a third option), because this scheme is much more productive and easier to implement.
\r
If the directory structure is very dynamic, you should use EAV because in this case, the saved resources will be spent on alter/drop requests to flat tables. But you will need to know the caching system, because the specific complexity of the sample data of one entity is significantly larger than in other schemes.
\r
Very long chose EAV and have never regretted it.
by
0 like 0 dislike
The easiest solution is to use document-oriented DB, like MongoDB/CouchDB.
by
0 like 0 dislike
Magento abandoned the use of EAV in the latest versions. Switched to normal flat.
by

Related questions

0 like 0 dislike
1 answer
asked Apr 9, 2019 by OgecuT
0 like 0 dislike
3 answers
asked Apr 1, 2019 by MUTOgen4eg
0 like 0 dislike
2 answers
asked Mar 25, 2019 by Fesor
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,839 users