What are the differences between EAV and Flat model?
What are the differences between EAV and Flat model?
What are the differences between EAV and Flat model?
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 product save in deferrent tables.
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.
The flat model uses just one table,
so it’s not normalized and uses more database space.
you may have to add more columns in database table in future.
It’s good when comes to performance,
as it will only require one query to load whole product instead of joining 5-6 tables to get just one product’s details.
Columns are called fields in flat model.