我目前正在创建一个拍卖网站,在那里应该可以创建一个或多个产品的拍卖。这应该通过一些不同的产品变体来管理。
我的问题是,我不确定是否已经构建了处理库存管理的最佳MySQL结构。下面是我的DB的样子:
Attributes AttributeValues Combinations
在这里,我将有以下连接:
Attributes is the "main" name of the attribute - e.g. "Size", "Colour" or so. This has a
ProductID (connecting it to a product).
AttributeValues is the value - e.g. "43", "44", "45"...
I connect this to Attributes on a field called AttributeID.然后我将创建一些组合-例如,如果一只鞋有更多的属性,就会生成一个组合。
Combinations has the name and stock of the product - connected
to a product on ProductID
- e.g. "Nike shoe, red, 43" or "T-shirt, blue, Large".
CombinationParts is then connecting to a product with an AuctionID and then
to a AttributeValue with AttributeValueID.编辑:我将库存连接到每个产品的原因是,我需要使其能够将更多产品连接到拍卖
这个想法是,当你创建一个拍卖时,你输入每种类型的数量,有库存。
我的问题是,我是否可以让同样的事情变得更容易?换句话说:当我需要将我的站点扩展到可能包含25,000个产品时,这是最优的吗?
发布于 2012-09-19 05:14:56
当可能的属性集未知时,有一个键-键-值表(产品X,“品牌”,“耐克”)是处理属性和值的好方法。它有时在查询时可能会很笨拙,但它更容易维护。
https://stackoverflow.com/questions/12484925
复制相似问题