Eav Data Model Concepts

  • 324 views
Uploaded on

This presentation covers EAV type of data modeling. We would check various aspects of data modeling and compare them with different types of data modeling. Basically this relates to a type of data …

This presentation covers EAV type of data modeling. We would check various aspects of data modeling and compare them with different types of data modeling. Basically this relates to a type of data modeling in database.

More in: Software
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
324
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
10
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. EAV data model Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 2. 1/2/12 Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014 About Me M70 101 – Magento Certified Developer Skills: PHP, Magento, SugarCRM, CakePHP, oSCommerce, CodeIgniter Connect Me: - Twitter : https://twitter.com/saaandh090 Facebook : https://www.facebook.com/sandeep.rout.359 LinkedIn : http://www.linkedin.com/pub/sandeep-rout/39 Google+ : https://plus.google.com/112206647165680165211/ Contact Me: Email: sandeepr@mindfiresolutions.com Skype: mfsi_sandeepr
  • 3. 1/2/12 Agenda  Introduction  History  EAV hierarchy structure  Data Retrieve  EAV when to use?  Attribute Set  Pros  Cons Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 4. 1/2/12 EAV Entity Attribute Value (EAV) is vertical data modeling instead of horizontal data modeling which we regularly use. In mathematics, this model is known as a sparse matrix. EAV is also known as object–attribute–value model, vertical database model and open schema. Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 5. 1/2/12 EAV History As a storage method EAV was used in early object-oriented languages like SIMULA 67. Functional languages such as LISP have also use EAV data structure. They contain storage structures that record object information in attribute-value pairs – a principle fundamental to EAV. Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 6. 1/2/12 EAV hierarchy structure EAV hierarchy structure includes these components: - Entity : A component with a definitive existence. Objects are entities. For e.g. Products, User etc - Attribute : The fields to which the entities are related. This are similar to column names in horizontal data models. Object properties are attributes i.e. :- Color, Name, Price etc Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 7. 1/2/12 - Value : The value to which entity and attribute maps to. They are similar to row value from horizontal database. Example :- John, $22, blue etc Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 8. 1/2/12 Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 9. 1/2/12 Data Retrieve Case :- To get phone no of employee whose id is 1 Basic model : SELECT phone_no FROM employee WHERE employee_id = 1; Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 10. 1/2/12 Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014 Eav model : SELECT value FROM employee_int as ei JOIN employee as e ON e.employee_id = ei.employee_id JOIN employee_attribute as ea ON ea.attribute_id = ei.attribute_id WHERE e.employee_id = 1 AND ea.attribute_name = 'phone_no'
  • 11. 1/2/12 EAV when to use? Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014 Consider a case where there is need to add new columns or remove new columns on a regular basis. If using a simple single table it needs frequent alteration of tables also causes complexities With EAV this can be done by simple addition of a new row in attributes table. So, generally eav is used in such cases.
  • 12. 1/2/12 Attribute Set Set of attributes combined to make the entity grouped with their respective attributes only. Example :- An online store having books and shirts. Attributes used by book are different from attributes used by shirt. So, they can be categorized into attributes set. Attribute set Shirt : size, color, price,material, manufacturer etc Attribute set Book : pages, author, type of binding,etc Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 13. 1/2/12 Pros  Flexible mechanism for attributes to work with any sort of entities  Scalability – Can change the required data without changing the structure of database tables  Independent of hierarchy of data. Less time to implement Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 14. 1/2/12 Cons  Performance  EAV don't store value as datatype specific. Similar type of data are all grouped in one. As int is generally used to store tinyint,int etc.  No grouping of entities Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 15. 1/2/12 Indexing This process is used to somehow compensate the poor performance of EAV structure. It is not similar to database indexing  This process is time consuming  In this process data from EAV structured tables are retrieved and store in flat tables  Initially done after all entity types are generated Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 16. 1/2/12  Need to perform this process regularly  Need to be performed on addition, updation and deletion of data  Makes the data retrieval easier and faster  It completely eliminates old table and generates new table when re-indexing is performed. Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 17. Question and Answer Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 18. Thank you Presenter: Sandeep Kumar Rout, Mindfire Solutions Date: 20/03/2014
  • 19. www.mindfiresolutions.com https://www.facebook.com/MindfireSolutions http://www.linkedin.com/company/mindfire-solutions http://twitter.com/mindfires