Entity Attribute Value Database vs. strict Relational Model Ecommerce

前端 未结 10 1353
谎友^
谎友^ 2020-11-22 05:23

It is safe to say that the EAV/CR database model is bad. That said,

Question: What database model, technique, or pattern should be used to deal with \"clas

10条回答
  •  礼貌的吻别
    2020-11-22 05:43

    It is safe to say that the EAV/CR database model is bad.

    No, it's not. It's just that they're an inefficient usage of relational databases. A purely key/value store works great with this model.

    Now, to your real question: How to store various attributes and keep them searchable?

    Just use EAV. In your case it would be a single extra table. index it on both attribute name and value, most RDBMs would use prefix-compression to on the attribute name repetitions, making it really fast and compact.

    EAV/CR gets ugly when you use it to replace 'real' fields. As with every tool, overusing it is 'bad', and gives it a bad image.

提交回复
热议问题