K
K
KLUBS2010-11-07 18:44:05
Database
KLUBS, 2010-11-07 18:44:05

Why is EAV solution bad for an online store?

I ran into a problem when there are different types of goods (clothes and TVs have few of the same parameters). I see 3 solutions to the problem

  • Serialized LOB is the easiest but no lookup
  • EAV is not a complicated implementation, there are no problems when updating the database. In general, like that. But HERE they write that it’s not very good.
  • Well, the most difficult and expensive (in terms of time) option is to separate goods into different tables

Actually there are thoughts? How to make it convenient for me as a programmer, so as not to redo everything and so that people feel comfortable?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
helios, 2010-11-07
@helios

Most of the shortcomings indicated on stackoverflow are corrected by well-built business logic. This can be seen on the example of the same Magento.
The only thing worth noting is that when switching to EAV, you need to evaluate whether the game is worth the candle.
If the structure of categories and/or product types is relatively constant and rarely changes, then it makes sense to use flat tables (what you have indicated in the third option), because such a scheme is much more productive and easier to implement.
If the directory structure is very dynamic, then you should use EAV, because in this case, resources that are spent on alter / drop queries in flat tables will be saved. But at the same time, it will be necessary to think over the caching system well, because. the specific complexity of data sampling for one entity is significantly greater than in other schemes.
I myself chose EAV for myself a very long time ago and have never regretted it.

T
TimTowdy, 2010-11-07
@TimTowdy

The simplest solution is to use document-oriented databases like MongoDB/CouchDB.

T
try4tune, 2010-11-07
@try4tune

Magento has deprecated the use of EAV in recent versions. Switched to the usual flat.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question