How are store/website-specific (or non-global) products attributes stored/queried in the Magento mysql database?

How are store/website-specific (or non-global) products attributes stored/queried in the Magento mysql database?

August 6, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How are store/website-specific (or non-global) products attributes stored/queried in the Magento mysql database?

Storing Non-Global Product Attributes in Magento: A Comprehensive Overview

As a seasoned developer and frequent user of the Magento e-commerce platform, I understand your curiosity about how non-global product attributes are handled within the MySQL database. Let’s delve into this question and explore the intricacies of Magento’s attribute storage and retrieval mechanisms.

Understanding Magento’s Attribute Scope

Magento uses the core_eav_attribute table to define product attributes. The is_global field in this table determines the scope of an attribute:

  • 0: Store View
  • 1: Global
  • 2: Website

In your case, you have two websites (Admin and Main) with corresponding store views. Your question revolves around how Magento stores and retrieves non-global attributes like “name” (attribute ID = 71).

The Catalog Product Entity Table

Magento uses the catalog_product_entity table as the base for storing product data. This table is joined with entity type-specific tables, such as catalog_product_entity_varchar, to store attribute values.

You correctly identified that non-global attributes are typically stored in rows where store_id = 0. However, let’s clarify why this happens and how Magento handles the retrieval of these values.

The Attribute Storage Mechanism

When you create an attribute with a specific scope (e.g., Store View), Magento initially stores all values in the default store (admin) row. This is done to provide a fallback value for when no store-specific value exists.

If you assign a different value for a particular store view, Magento performs the following:

  1. Checks if a value already exists for that attribute and store combination.
  2. If not, creates a new row in the entity type-specific table (e.g., catalog_product_entity_varchar) with the appropriate store_id (1 or higher).
  3. Populates this new row with the specified value.

The Attribute Retrieval Process

When Magento retrieves an attribute value for a specific product and store scope, it follows a logical sequence:

  1. Checks if the attribute is global (is_global = 1). If so, it directly fetches the value from the store_id = 0 row.
  2. If the attribute is non-global, Magento first attempts to retrieve the value from the specific store’s row (e.g., store_id = 1).
  3. If no value is found in the specific store’s row, it falls back to the default value stored in the store_id = 0 row.

Best Practices for Retrieving Attribute Values

When writing your own queries to retrieve attribute values, consider the following best practices:

  1. Always check the is_global flag first.
  2. If the attribute is non-global, query both the specific store’s row and the default row.
  3. Compare the retrieved values and choose the appropriate one based on the current store context.

Conclusion

In summary, Magento stores non-global product attributes in a way that allows for easy fallback to default values when no store-specific value exists. The is_global flag is crucial for determining the retrieval strategy, and developers should always consider this when working with attribute data.

For more information on Magento’s database schema and best practices for attribute management, I recommend exploring the official documentation and resources provided by the Magento community.

Happy coding!

Catalog Database Admin

Our network