Posts: 1
Registered: ‎09-09-2021

EAV Table Alternatives for Product Attributes

My e-commerce website uses an Entity-Attribute-Value table to store product attribute/filter data. I created this system about 5 years ago after looking at how some of the big players like Magento and Shopify lay out their own databases.

For context: we have approximately 35,000 products, 150 product types and around 750 unique attributes. These numbers are always growing, and are never finalised, as we're always trying to improve the data we hold and display.

I'm in the process of upgrading some of our other systems, and the EAV pattern makes sense to start using for another of them, in my opinion. Before committing the ultimate sin of having a second EAV table for this new purpose, I thought I'd see whether there is any less hate for the EAV pattern... there is not.

I understand that's it's an anti-pattern, and that it's impossible to validate the data properly - but what is the alternative? All my research online has shown a lot of disgust for EAV tables but with no alternative offered. I can't imagine a 750-column table is the way to go for product attributes. What other ways can I store relational data where the goalposts are always moving?