SlideShare uma empresa Scribd logo
1 de 29
WAS IST EIGENTLICH EAV?
        Eine Einführung in das Entity-Attribute-Value Model



                                  PHP User Group Rheinhessen
                                       12.01.2010 Mainz




Daniel Nitz — www.danielnitz.de               1                12.01.2010 — PHPUG-RHH
AGENDA

          1. Definition                  4. Nachteile

          2. Anwendungsbeispiel         5. In der Praxis

          3. Vorteile                   6. Fazit



Daniel Nitz — www.danielnitz.de     2              12.01.2010 — PHPUG-RHH
DEFINITION




Daniel Nitz — www.danielnitz.de       3        12.01.2010 — PHPUG-RHH
DEFINITION


  Entity-Attribute-Value Model, auch bekannt als Object-
  Attribute-Value Model und Open Schema ist ein Datenmodell,
  welches dann zum Einsatz kommt, wenn die Anzahl der
  Attribute (Eigenschaften, Parameter) zur Beschreibung einer
  Sache (Entität oder Objekt) im Vorfeld nicht vorhersehbar sind.



Daniel Nitz — www.danielnitz.de       4           12.01.2010 — PHPUG-RHH
DEFINITION



  EAV ist ein Datenmodell für den Fall, dass die Anzahl der
  Attribute eines Objektes nicht vorhersehbar sind.




Daniel Nitz — www.danielnitz.de       5           12.01.2010 — PHPUG-RHH
DEFINITION


  Entity: Repräsentiert einen Datensatz, z.B. eine Produkt.

  Attribute: Stellt eine Eigenschaft dar, z.B. Größe, Farbe etc.

  Value: Beinhaltet den Eigenschaftswert, z.B. XL, blau etc.



Daniel Nitz — www.danielnitz.de       6                12.01.2010 — PHPUG-RHH
DEFINITION

                                  1:n               1:1
                  Entity                Attribute            Value




                       3 Tabellen verknüpft mittels Foreign Keys.



Daniel Nitz — www.danielnitz.de             7                12.01.2010 — PHPUG-RHH
HÄ?



Daniel Nitz — www.danielnitz.de    8    12.01.2010 — PHPUG-RHH
ANWENDUNGSBEISPIEL
           Unterschied EAV im Vergleich zum relationalen Design




Daniel Nitz — www.danielnitz.de     9                 12.01.2010 — PHPUG-RHH
ANWENDUNGSBEISPIEL

‣   Eine Person wird anhand einer eindeutigen Nummer
    identifiziert

‣   Eine Person hat einen Vornamen

‣   Eine Person hat einen Nachnamen

‣   Ein Person hat eine beliebige Anzahl von zusätzlichen
    Informationen (Alter, Gewicht, Größe etc.)
Daniel Nitz — www.danielnitz.de   10                12.01.2010 — PHPUG-RHH
RELATIONALES DESIGN
                                   Person             Data

                                  person_id   1:1   person_id
                                  first_name         age
                                  last_name         weight
                                                    height




Daniel Nitz — www.danielnitz.de               11                12.01.2010 — PHPUG-RHH
EAV DESIGN

                  Entity                  Attribute               Value
                                                         1:1
               entity_id          1:n
                                        attribute_id           attribute_id
                                        entity_id              value
                                        attribute_name




Daniel Nitz — www.danielnitz.de               12                 12.01.2010 — PHPUG-RHH
STORY
Relationales Design:
Die Person mit der Nummer 1 hat das Alter 30, hat ein Gewicht von 80,
hat eine Größe von 180.


EAV Design:
Die Person mit der Nummer 1 hat das Attribut Alter mit dem Wert 30.

Die Person mit der Nummer 1 hat das Attribut Gewicht mit dem Wert 80.

Die Person mit der Nummer 1 hat das Attribut Größe mit dem Wert 180.

 Daniel Nitz — www.danielnitz.de     13                 12.01.2010 — PHPUG-RHH
DESIGN PROBLEME


‣   keine Datentypen

‣   keine definierten Spalten-/Attributsets

‣   Redundanz von Attributen

‣   keine Integrität


Daniel Nitz — www.danielnitz.de   14         12.01.2010 — PHPUG-RHH
EAV DESIGN

                  Entity                  Attribute                            Value
                                                               1:1
               entity_id          1:n
                                        attribute_id                        attribute_id
                                        entity_id                           value_id
                                        attribute_name

                                                         1:1                            1:1



                                                                Value Int                Value ...

                                                               value_id                value_id
                                                               value                   value


Daniel Nitz — www.danielnitz.de               15                              12.01.2010 — PHPUG-RHH
EAV DESIGN

                  Entity                    Entity_Attribute                         Value
                                                                     1:1
               entity_id          1:n
                                            ea_id                                 ea_id
                                            entity_id                             value_id
                                            attribute_id
                                            as_id
                                                               1:1                            1:1



               Attribute Set              Attribute                   Value Int                Value ...

             as_id                      attribute_id                 value_id                value_id
             as_name                    attribute_name               value                   value


Daniel Nitz — www.danielnitz.de                   16                                12.01.2010 — PHPUG-RHH
DESIGN PROBLEME


‣   verschiedene Datentypen

‣   definierte Spalten-/Attributsets

‣   keine Redundanz von Attributen

‣   Integrität gewahrt


Daniel Nitz — www.danielnitz.de   17   12.01.2010 — PHPUG-RHH
VORTEILE




Daniel Nitz — www.danielnitz.de      18      12.01.2010 — PHPUG-RHH
VORTEILE


‣   Hohe Flexibilität in der Gestaltung von Objektstrukturen

‣   Kein DBA zur Änderung der Schemata nötig

‣   Keine zusätzliche Programmierung bei Änderung der
    Schemata nötig


Daniel Nitz — www.danielnitz.de      19            12.01.2010 — PHPUG-RHH
NACHTEILE




Daniel Nitz — www.danielnitz.de       20      12.01.2010 — PHPUG-RHH
NACHTEILE


‣   Hohe Systemlast durch komplizierte SQL Queries

‣   Komplexe Programmierung von SQL Statements

‣   Verlust von DBMS-spezifischen Funktionalitäten

‣   Verlagerung von DBMS-Funktionen in die Anwendungslogik


Daniel Nitz — www.danielnitz.de       21            12.01.2010 — PHPUG-RHH
IN DER PRAXIS




Daniel Nitz — www.danielnitz.de         22        12.01.2010 — PHPUG-RHH
EAV MODEL LIBRARY

Dmg_Db_Eav:
‣   EAV Model Implementierung für das Zend Framework

‣   Auf Basis von Zend_Db und Zend_Db_Table

‣   Nutzung von Zend_Cache



Daniel Nitz — www.danielnitz.de   23          12.01.2010 — PHPUG-RHH
CODE BEISPIEL

 $options = new Dmg_Db_Eav_Config($array);

 // Person implements Dmg_Db_Eav_Abstract
 $personModel = new Person($options);

 $persons = $personModel->addAttributeFilter('age', 30)
    	 	 	 	 	           ->addAttributeFilter('name', 'daniel')
                        ->addFilter('active', 1)
                        ->addLimit(10)
                        ->load();




Daniel Nitz — www.danielnitz.de         24         12.01.2010 — PHPUG-RHH
CODE BEISPIEL
foreach ($persons as $person) {
	 $attributes = $person->getAttributes();
	 foreach ($attributes as $attribute) {
	 	 if (!$attribute->hasOptions()) {
	 	 	 echo $attribute->getName() . ': ' . $attribute->getValue();
	 	 } else {
	 	 	 foreach ($attribute->getOptions() as $option) {
	 	 	 	 echo $option->getName() . ': ' . $option->getValue();
	 	 	 }
	 	 }
	 }
}



Daniel Nitz — www.danielnitz.de         25        12.01.2010 — PHPUG-RHH
PERFORMANCE
 #            Time                                                                         Query
 1     0.223762989044    connect

                         SELECT `e`.*, `v`.*, `a`.*, `as`.*, `g`.*, `ga`.* FROM `eav_entity` AS `e` INNER JOIN `eav_value` AS `v` ON e.entity_id = v.entity_id INNER
                         JOIN `eav_attribute` AS `a` ON v.attribute_id = a.attribute_id INNER JOIN `eav_attribute_set` AS `as` ON e.attribute_set_id =
 2     0.42297410965
                         as.attribute_set_id INNER JOIN `eav_attribute_group` AS `g` ON g.attribute_set_id = as.attribute_set_id INNER JOIN
                         `eav_attribute_group_attribute` AS `ga` ON a.attribute_id = ga.attribute_id WHERE (e.entity_id = 1)

 3     0.0507569313049   DESCRIBE `eav_entity`

                         SELECT eav_value_varchar.*, CONCAT('varchar') AS type FROM eav_value_varchar WHERE value_id IN (1, 3) UNION SELECT
 4     0.757645130157    eav_value_int.*, CONCAT('int') AS type FROM eav_value_int WHERE value_id IN (2) UNION SELECT eav_value_text.*, CONCAT('text') AS
                         type FROM eav_value_text WHERE value_id IN (4)


 ...            ...                                                                           ...



Query Zeit beim Laden eines EAV Objektes ohne Cache mit 4
Attributen, eines davon hat 6 Attributoptionen: 1.949 sec
Nach dem Caching: 0.079 sec
Daniel Nitz — www.danielnitz.de                                             26                                                  12.01.2010 — PHPUG-RHH
FAZIT




Daniel Nitz — www.danielnitz.de     27    12.01.2010 — PHPUG-RHH
FAZIT

‣   EAV bietet gute Möglichkeiten eine Anwendung in der
    Datenschicht flexibel zu halten.

‣   Es gibt jedoch nur wenige Anwendungsfälle, in denen eine EAV
    Implementierung wirklich sinnvoll ist.

‣   Ein relationales Design sollte dem EAV, wenn möglich,
    vorgezogen werden.

Daniel Nitz — www.danielnitz.de     28             12.01.2010 — PHPUG-RHH
VIELEN DANK!

                                            Daniel Nitz
                                            [ zend certified engineer ]

                                            daniel@danielnitz.de
                                            twitter.com/danielnitz




Daniel Nitz — www.danielnitz.de        29                 12.01.2010 — PHPUG-RHH

Mais conteúdo relacionado

Mais procurados

Corrigé TP NoSQL MongoDB (5).pdf
Corrigé TP NoSQL MongoDB (5).pdfCorrigé TP NoSQL MongoDB (5).pdf
Corrigé TP NoSQL MongoDB (5).pdf
OumaimaZiat
 
파이썬 프로퍼티 디스크립터 이해하기
파이썬 프로퍼티 디스크립터 이해하기파이썬 프로퍼티 디스크립터 이해하기
파이썬 프로퍼티 디스크립터 이해하기
Yong Joon Moon
 
PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...
Jinwon Lee
 

Mais procurados (20)

Corrigé TP NoSQL MongoDB (5).pdf
Corrigé TP NoSQL MongoDB (5).pdfCorrigé TP NoSQL MongoDB (5).pdf
Corrigé TP NoSQL MongoDB (5).pdf
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
 
파이썬 프로퍼티 디스크립터 이해하기
파이썬 프로퍼티 디스크립터 이해하기파이썬 프로퍼티 디스크립터 이해하기
파이썬 프로퍼티 디스크립터 이해하기
 
BigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans HadoopBigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans Hadoop
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bug
 
PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...
 
Data mining - Classification - arbres de décision
Data mining - Classification - arbres de décisionData mining - Classification - arbres de décision
Data mining - Classification - arbres de décision
 
Towards Dropout Training for Convolutional Neural Networks
Towards Dropout Training for Convolutional Neural Networks Towards Dropout Training for Convolutional Neural Networks
Towards Dropout Training for Convolutional Neural Networks
 
Graphs in the Database: Rdbms In The Social Networks Age
Graphs in the Database: Rdbms In The Social Networks AgeGraphs in the Database: Rdbms In The Social Networks Age
Graphs in the Database: Rdbms In The Social Networks Age
 
spark_intro_1208
spark_intro_1208spark_intro_1208
spark_intro_1208
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An Overview
 
GPT-X
GPT-XGPT-X
GPT-X
 
Large scale-lm-part1
Large scale-lm-part1Large scale-lm-part1
Large scale-lm-part1
 
Chapitre i-intro
Chapitre i-introChapitre i-intro
Chapitre i-intro
 
Base de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvreBase de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvre
 
Apache Spark with Scala
Apache Spark with ScalaApache Spark with Scala
Apache Spark with Scala
 
Using HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py moduleUsing HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py module
 
Cours Big Data Chap3
Cours Big Data Chap3Cours Big Data Chap3
Cours Big Data Chap3
 
OpenCV Introduction
OpenCV IntroductionOpenCV Introduction
OpenCV Introduction
 
NoSQL et Big Data
NoSQL et Big DataNoSQL et Big Data
NoSQL et Big Data
 

Destaque

Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
Tâm
 
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
Erik Fransen
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecture
pcherukumalla
 

Destaque (12)

Eav Data Model Concepts
Eav Data Model ConceptsEav Data Model Concepts
Eav Data Model Concepts
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
 
Extensible Data Modeling
Extensible Data ModelingExtensible Data Modeling
Extensible Data Modeling
 
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
 
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
Best Practices: Datawarehouse Automation Conference September 20, 2012 - Amst...
 
Implementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord modelsImplementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord models
 
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
 
SQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and ProfitSQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and Profit
 
Modern Data Architecture
Modern Data ArchitectureModern Data Architecture
Modern Data Architecture
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecture
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best Practices
 
Building an Effective Data Warehouse Architecture
Building an Effective Data Warehouse ArchitectureBuilding an Effective Data Warehouse Architecture
Building an Effective Data Warehouse Architecture
 

Was ist eigentlich EAV?

  • 1. WAS IST EIGENTLICH EAV? Eine Einführung in das Entity-Attribute-Value Model PHP User Group Rheinhessen 12.01.2010 Mainz Daniel Nitz — www.danielnitz.de 1 12.01.2010 — PHPUG-RHH
  • 2. AGENDA 1. Definition 4. Nachteile 2. Anwendungsbeispiel 5. In der Praxis 3. Vorteile 6. Fazit Daniel Nitz — www.danielnitz.de 2 12.01.2010 — PHPUG-RHH
  • 3. DEFINITION Daniel Nitz — www.danielnitz.de 3 12.01.2010 — PHPUG-RHH
  • 4. DEFINITION Entity-Attribute-Value Model, auch bekannt als Object- Attribute-Value Model und Open Schema ist ein Datenmodell, welches dann zum Einsatz kommt, wenn die Anzahl der Attribute (Eigenschaften, Parameter) zur Beschreibung einer Sache (Entität oder Objekt) im Vorfeld nicht vorhersehbar sind. Daniel Nitz — www.danielnitz.de 4 12.01.2010 — PHPUG-RHH
  • 5. DEFINITION EAV ist ein Datenmodell für den Fall, dass die Anzahl der Attribute eines Objektes nicht vorhersehbar sind. Daniel Nitz — www.danielnitz.de 5 12.01.2010 — PHPUG-RHH
  • 6. DEFINITION Entity: Repräsentiert einen Datensatz, z.B. eine Produkt. Attribute: Stellt eine Eigenschaft dar, z.B. Größe, Farbe etc. Value: Beinhaltet den Eigenschaftswert, z.B. XL, blau etc. Daniel Nitz — www.danielnitz.de 6 12.01.2010 — PHPUG-RHH
  • 7. DEFINITION 1:n 1:1 Entity Attribute Value 3 Tabellen verknüpft mittels Foreign Keys. Daniel Nitz — www.danielnitz.de 7 12.01.2010 — PHPUG-RHH
  • 8. HÄ? Daniel Nitz — www.danielnitz.de 8 12.01.2010 — PHPUG-RHH
  • 9. ANWENDUNGSBEISPIEL Unterschied EAV im Vergleich zum relationalen Design Daniel Nitz — www.danielnitz.de 9 12.01.2010 — PHPUG-RHH
  • 10. ANWENDUNGSBEISPIEL ‣ Eine Person wird anhand einer eindeutigen Nummer identifiziert ‣ Eine Person hat einen Vornamen ‣ Eine Person hat einen Nachnamen ‣ Ein Person hat eine beliebige Anzahl von zusätzlichen Informationen (Alter, Gewicht, Größe etc.) Daniel Nitz — www.danielnitz.de 10 12.01.2010 — PHPUG-RHH
  • 11. RELATIONALES DESIGN Person Data person_id 1:1 person_id first_name age last_name weight height Daniel Nitz — www.danielnitz.de 11 12.01.2010 — PHPUG-RHH
  • 12. EAV DESIGN Entity Attribute Value 1:1 entity_id 1:n attribute_id attribute_id entity_id value attribute_name Daniel Nitz — www.danielnitz.de 12 12.01.2010 — PHPUG-RHH
  • 13. STORY Relationales Design: Die Person mit der Nummer 1 hat das Alter 30, hat ein Gewicht von 80, hat eine Größe von 180. EAV Design: Die Person mit der Nummer 1 hat das Attribut Alter mit dem Wert 30. Die Person mit der Nummer 1 hat das Attribut Gewicht mit dem Wert 80. Die Person mit der Nummer 1 hat das Attribut Größe mit dem Wert 180. Daniel Nitz — www.danielnitz.de 13 12.01.2010 — PHPUG-RHH
  • 14. DESIGN PROBLEME ‣ keine Datentypen ‣ keine definierten Spalten-/Attributsets ‣ Redundanz von Attributen ‣ keine Integrität Daniel Nitz — www.danielnitz.de 14 12.01.2010 — PHPUG-RHH
  • 15. EAV DESIGN Entity Attribute Value 1:1 entity_id 1:n attribute_id attribute_id entity_id value_id attribute_name 1:1 1:1 Value Int Value ... value_id value_id value value Daniel Nitz — www.danielnitz.de 15 12.01.2010 — PHPUG-RHH
  • 16. EAV DESIGN Entity Entity_Attribute Value 1:1 entity_id 1:n ea_id ea_id entity_id value_id attribute_id as_id 1:1 1:1 Attribute Set Attribute Value Int Value ... as_id attribute_id value_id value_id as_name attribute_name value value Daniel Nitz — www.danielnitz.de 16 12.01.2010 — PHPUG-RHH
  • 17. DESIGN PROBLEME ‣ verschiedene Datentypen ‣ definierte Spalten-/Attributsets ‣ keine Redundanz von Attributen ‣ Integrität gewahrt Daniel Nitz — www.danielnitz.de 17 12.01.2010 — PHPUG-RHH
  • 18. VORTEILE Daniel Nitz — www.danielnitz.de 18 12.01.2010 — PHPUG-RHH
  • 19. VORTEILE ‣ Hohe Flexibilität in der Gestaltung von Objektstrukturen ‣ Kein DBA zur Änderung der Schemata nötig ‣ Keine zusätzliche Programmierung bei Änderung der Schemata nötig Daniel Nitz — www.danielnitz.de 19 12.01.2010 — PHPUG-RHH
  • 20. NACHTEILE Daniel Nitz — www.danielnitz.de 20 12.01.2010 — PHPUG-RHH
  • 21. NACHTEILE ‣ Hohe Systemlast durch komplizierte SQL Queries ‣ Komplexe Programmierung von SQL Statements ‣ Verlust von DBMS-spezifischen Funktionalitäten ‣ Verlagerung von DBMS-Funktionen in die Anwendungslogik Daniel Nitz — www.danielnitz.de 21 12.01.2010 — PHPUG-RHH
  • 22. IN DER PRAXIS Daniel Nitz — www.danielnitz.de 22 12.01.2010 — PHPUG-RHH
  • 23. EAV MODEL LIBRARY Dmg_Db_Eav: ‣ EAV Model Implementierung für das Zend Framework ‣ Auf Basis von Zend_Db und Zend_Db_Table ‣ Nutzung von Zend_Cache Daniel Nitz — www.danielnitz.de 23 12.01.2010 — PHPUG-RHH
  • 24. CODE BEISPIEL $options = new Dmg_Db_Eav_Config($array); // Person implements Dmg_Db_Eav_Abstract $personModel = new Person($options); $persons = $personModel->addAttributeFilter('age', 30) ->addAttributeFilter('name', 'daniel') ->addFilter('active', 1) ->addLimit(10) ->load(); Daniel Nitz — www.danielnitz.de 24 12.01.2010 — PHPUG-RHH
  • 25. CODE BEISPIEL foreach ($persons as $person) { $attributes = $person->getAttributes(); foreach ($attributes as $attribute) { if (!$attribute->hasOptions()) { echo $attribute->getName() . ': ' . $attribute->getValue(); } else { foreach ($attribute->getOptions() as $option) { echo $option->getName() . ': ' . $option->getValue(); } } } } Daniel Nitz — www.danielnitz.de 25 12.01.2010 — PHPUG-RHH
  • 26. PERFORMANCE # Time Query 1 0.223762989044 connect SELECT `e`.*, `v`.*, `a`.*, `as`.*, `g`.*, `ga`.* FROM `eav_entity` AS `e` INNER JOIN `eav_value` AS `v` ON e.entity_id = v.entity_id INNER JOIN `eav_attribute` AS `a` ON v.attribute_id = a.attribute_id INNER JOIN `eav_attribute_set` AS `as` ON e.attribute_set_id = 2 0.42297410965 as.attribute_set_id INNER JOIN `eav_attribute_group` AS `g` ON g.attribute_set_id = as.attribute_set_id INNER JOIN `eav_attribute_group_attribute` AS `ga` ON a.attribute_id = ga.attribute_id WHERE (e.entity_id = 1) 3 0.0507569313049 DESCRIBE `eav_entity` SELECT eav_value_varchar.*, CONCAT('varchar') AS type FROM eav_value_varchar WHERE value_id IN (1, 3) UNION SELECT 4 0.757645130157 eav_value_int.*, CONCAT('int') AS type FROM eav_value_int WHERE value_id IN (2) UNION SELECT eav_value_text.*, CONCAT('text') AS type FROM eav_value_text WHERE value_id IN (4) ... ... ... Query Zeit beim Laden eines EAV Objektes ohne Cache mit 4 Attributen, eines davon hat 6 Attributoptionen: 1.949 sec Nach dem Caching: 0.079 sec Daniel Nitz — www.danielnitz.de 26 12.01.2010 — PHPUG-RHH
  • 27. FAZIT Daniel Nitz — www.danielnitz.de 27 12.01.2010 — PHPUG-RHH
  • 28. FAZIT ‣ EAV bietet gute Möglichkeiten eine Anwendung in der Datenschicht flexibel zu halten. ‣ Es gibt jedoch nur wenige Anwendungsfälle, in denen eine EAV Implementierung wirklich sinnvoll ist. ‣ Ein relationales Design sollte dem EAV, wenn möglich, vorgezogen werden. Daniel Nitz — www.danielnitz.de 28 12.01.2010 — PHPUG-RHH
  • 29. VIELEN DANK! Daniel Nitz [ zend certified engineer ] daniel@danielnitz.de twitter.com/danielnitz Daniel Nitz — www.danielnitz.de 29 12.01.2010 — PHPUG-RHH