What are the differences between EAV and Flat model?

devquora
devquora

Posted On: Nov 17, 2022

 

EAV is an entity attribute value database model, where data is fully in normalized form. Each column data value is stored in their respective data type table. For example, for a product, the product ID is stored in catalog_product_entity_int table, product name in catalog_product_entity_varchar, product price in catalog_product_entity_decimal, product created date in catalog_product_entity_datetime and product description in catalog_product_entity_text table. EAV is complex as it joins 5-6 tables even if you want to get just one product’s details. Columns are called attributes in EAV.

The flat model uses just one table, so it’s not normalized and uses more database space. It clears the EAV overhead, but not good for dynamic requirements where you may have to add more columns in the database table in the future. It’s good when comes to performance, as it will only require one query to load the whole product instead of joining 5-6 tables to get just one product’s details. Columns are called fields in a flat model.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Magento Interview Questions

    What is Magento?

    Magento is free open source e-commerce software written PHP language, that allows merchants to create online e-commerce..

    Magento Interview Questions

    Explain Registry pattern in Magento?

    Registry pattern is basically a pattern that allows any object or data to be available in a public global scope for any..

    Magento Interview Questions

    What are the different versions of Magento?

    Four different versions of Magento are available, they are Magento Enterprise Edition Magento Community Edition Magento..