Magento Expert Forum - Improve your Magento experience

Results 1 to 4 of 4

What is EAV in Magento ?

  1. #1
    Junior Member balwant's Avatar
    Join Date
    Jul 2014
    Posts
    107
    Thanks
    1
    Thanked 5 Times in 5 Posts

    Default What is EAV in Magento ?

    EAV, stands for Entity Attribute Value, is a technique which allows you to add unlimited columns to your table virtually. Means, the fields which is represented in “column” way in a regular table, is represented in a “row” (records) way in EAV. In EAV, you have one table which holds all the “attribute” (table field names) data, and other tables which hold the “entity” (id or primary id) and value (value for that id) against each attribute.

    In Magento, there is one table to hold attribute values called eav_attribute and 5-6 tables which holds entity and data in fully normalized form,

    - eav_entity, eav_entity_int (for holding Integer values),
    - eav_entity_varchar (for holding Varchar values),
    - eav_entity_datetime (for holding Datetime values),
    - eav_entity_decimal (for holding Decimal/float values),
    - eav_entity_text (for holding text (mysql Text type) values).

    EAV is expensive and should only be used when you are not sure about number of fields in a table which can vary in future. To just get one single record, Magento joins 4-5 tables to get data in EAV. But this doesn’t mean that EAV only has drawbacks. The main advantage of EAV is when you may want to add table field in future, when there are thousands or millions of records already present in your table. In regular table, if you add table field with these amount of data, it will screw up your table, as for each empty row also some bytes will be allocated as per data type you select. While in EAV, adding the table column will not affect the previously saved records (also the extra space will not get allocated!) and all the new records will seamlessly have data in these columns without any problem.

    Thanks
    iLoveMage.com

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Jan 2015
    Posts
    195
    Thanks
    3
    Thanked 4 Times in 4 Posts

    Default

    EAV also known as object attribute value model and open schema.

  3. #3
    Junior Member
    Join Date
    Aug 2016
    Posts
    72
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    EAV stand for Entity Attribute value. EAV also known as object attribute value model and open schema.
    EAV used because of scalability. We can insert anything without changing its structure. Magento uses EAV structure because its designed to be scalable, regardless of speed problem.

  4. #4
    Junior Member
    Join Date
    Sep 2018
    Location
    Canada
    Posts
    873
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Magento EAV (Entity Attribute Value) data model is used to get flexibility for your data, but it brings more complexity than relation table model. If you need data model that will have flexible attributes which can be dynamically added, for example from Magento admin panel, then EAV is the best solution for you.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •