How many database tables will Magento create when you make a new EAV module?

How many database tables will Magento create when you make a new EAV module?

October 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How many database tables will Magento create when you make a new EAV module?

How Many Database Tables Will Magento Create for an EAV Module?

If you’re developing an extension for Magento using the Entity-Attribute-Value (EAV) pattern, you might be wondering how many database tables this will create in your store’s database. Let me walk you through the process and give you a precise answer.

Understanding the EAV Pattern

The EAV model is flexible but can lead to performance issues if not managed properly. In Magento, an EAV module typically consists of three core tables:

  1. The entity table: Stores the basic information about your custom entity (e.g., customer_address for a customer address book).

  2. The attribute set table: Defines the groups of attributes that can be assigned to entities.

  3. The attribute value table: Stores the actual values of attributes for each entity instance.

How Many Tables Are Actually Created?

When you create an EAV module in Magento, the system automatically generates the following tables:

  • One table for your custom entity (e.g., customer_address).
  • One table to store attribute sets related to your entity.
  • One table for storing attribute values associated with your entities.

So, for a single EAV module, you will have 3 database tables created by default.

Example: Creating a Customer Address Book

Let me demonstrate this using the built-in customer_address module as an example:

  1. The customer_address entity is stored in the customer_entity table.
  2. The attribute sets (like ‘Customer Address Attributes’) are defined in the eav_attribute_set table.
  3. Individual attribute values (such as street, city, country) for each customer address are stored in the eav_attribute and catalog_eav_attribute tables.

Performance Considerations

While Magento’s EAV model offers great flexibility, it can significantly impact performance if you create too many attributes or modules that use this pattern. To mitigate this:

  • Use EAV judiciously: Only create EAV entities when necessary.
  • Limit the number of attributes per entity set: Too many attributes can slow down queries.
  • Optimize indexes and caching strategies.

Conclusion

In summary, creating a new EAV module in Magento will result in 3 database tables being created by default. While this pattern provides flexibility for custom data structures, it’s crucial to use it responsibly to avoid performance degradation.

For further reading on Magento’s architecture and best practices, I recommend checking out our comprehensive guide at LaravelCompany: Understanding Magento’s Database Schema.

Database Performance Extensions Customers

Our network