Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am building an eCommerce application that will be hosted on Heroku, use their Postgres database, and the app will be built with Django. There will be a massive amount of products & product categories with detailed information for each product category. Each product category will have very different fields. For example computers vs clothing. What is the best way to set up the data structure? (Opt a) Lump all detail fields into one table. (Opt B) create a separate table for each type of product detail. (Opt C) One table for all products and details. Or some other option i have not thought of? Below is an extremely abbreviated example of the data structures and associated fields.

OPT A

Table 1 = All products
- Id
- Name
- Model#
- Manufacturer
- Image
- Foreign Key to appropriate product details

Table 2 = Computers (product detail)
- Ram
- Cpu

Table 3 = Clothing (product detail)
- Size
- Color

OPT B

Table 1 = Products
- Id
- Name
- Model
- Make
- Image
- Foreign Key to product detail

Table 2 = Product Detail
- Size
- Color
- Ram
- Cpu

OPT C

Table 1 = Products
- Id
- Name
- Model#
- Manufacturer
- Image
- Size
- Color
- Ram
- Cpu
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.