Thursday, March 29, 2012

Ecommerce database design?

I am setting up a simple store to sell a few products and need some input on
how to design the database for the best efficiency.
Many but not all of the products I sell will have variants. For example, I
will be selling photo prints of different sizes - 5x7, 11x14, etc. , and
packs of cards in varying quantities. They are just different sizes of the
same product, so I don't really want to set each one up as a separate
product record.
However, each size will be a different price so that has to be designed for
too.
Can you direct me to an example of the best way to set up tables to allow
for such a project?
Thanks,
PaulPaul
I think the 'proper' design would call for two tables. One
for the base products, this would have a product-type ie
photo prints, product-id and any other data that was
common to all versions of the product (maybe a foreign key
to a supplier table).
The second table would be the product version table, where
you would have a row for every different version of the
product.
I say 'proper' design because depending on the amount of
data items in each table and the volumes you are dealing
with you may find your system runs better if you de-
normalise the table and make it just one table anyway.
Hope this helps. (And does not confuse.)
Regards
John

No comments:

Post a Comment