Storing variable product attributes as json in mysql or eav table?
Hi all,
I'm making a product management application for e-commerce solutions. its really something i struggle with for clients maintaining their product data and distributing it to multiple channels but all channels accept different formats, Excel, Csv, Xml and so on. Some via feed and some via update.
Anyhow i have been playing around with database structures of products trying to map them towards different field. One would call a product name a "name" the other site a "title"
There are 2 approaches im considering.
- Some kind of eav kind of structure where all often used fields are in a products table such as: name, short description, description, price, special price, qty, stock status, main image url. A second table would be called attibributes with columns key, value, product_id. or even extending it into attribute type specific columns (integer, varchar, text and so on)
My main concern is that making a feed with field transforms of about 50.000 products would be very heavy. While it is very structured. But each product can have like 10 or 20 attribute rows.
- The other kind is more like a json storage of attributes. have the same base product table as above for indexing and such. but having all other variable attributes in a json format either inside the products table or seperate in a attributes table making the processes on the database much easier to consume right.
My concrete question is, do you guys have experience, common pitfalls or warning for me moving forward. Since this is a very important cornerstone piece in my application i am worried to make the wrong decision and therefore the application is not progressing right now. Hoping to get some insight on this. thank for the help!
Please or to participate in this conversation.