2

Is Magento attribute value saved in database table static and varchar identical?

when and why to use static backend_type instead of varchar?

-2

EAV is a flexible solution to storing data in a database. Relational databases are ideal for situations where there is a fixed number of descriptors (columns) for an entity row. This works well for, say, storing CMS pages or admin user details. But it does not work well for products as they can have a variable (and semi-infinite) number of descriptors (columns). While the data is split up across five or more tables, the end result in the Magento application is that a product is loaded with the set data as if it was one row (Magento handles the saving and loading operation from multiple tables). In other words, EAV stores its relational-columnar information in rows. Instead of data representing the same entity being stored horizontally, it is stored vertically. EAV is made up of three components. The entity, the attribute, and the attribute value.

Entity: EAV stores the primary key in the entity table (for example, catalog_product_entity). Columns in this table are considered static (see the backend_ type column in the eav_attribute table). You can find the entity types in eav_entity_type.

Attribute: Attributes are stored in eav_attribute. Each attribute represents a "column" in the loaded Magento product.

Value: Each attribute has a backend_type. This value determines which table the values for that attribute are stored in. static means those values are stored in the parent _entity table. Otherwise, look for a table with _ entity_ [backend_ type]. The value is the last column. The first columns relate the value to the entity row, store, and the attribute ID.

  • value stored in static that is entity table and value stored in varchar is that identical . when to use static entity table colum instead of varchar for saving data – Muhammad Hossain Oct 11 '18 at 13:49
  • Kindly refer below link inviqa.com/blog/eav-data-model – Nilesh Gosai Oct 12 '18 at 5:50
  • 1
    static mean you have to create a new column on main entity_ table also. eg: customer_entity – Tuyen Nguyen Jun 28 at 3:46
  • static column in OOTB – Nilesh Gosai Jul 1 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.