Some thoughts on the design of commodity module database in mall system

Source: Internet
Author: User
Some thoughts on the design of commodity module database in mall system

Generally we have to do the mall system is relatively large, the most basic is the design of the commodity table, a commodity is also involved in the properties of goods, specifications, classification, each specification has a different inventory and price, so the database design needs to be balanced, one is convenient to expand, the other is convenient to query.

Read some of the design of the network, specifications design this piece is divided into horizontal and vertical said, horizontal seems to say that each specification occupies a field, so the size of a lot of database fields should also be dynamic increase, very inconvenient; longitudinal words separate out the specification table for design (presumably this meaning, understand the wrong words welcome at any time to point out).

First look at the final PDM diagram to be designed:

Table explanation

属性表:存放商品各种属性,比如材质、工艺、产地、面料成分等商品表:存放真正待售商品,好理解类别表:存放商品类别,比如:居家、餐厨、饮食、配件等规格表:存放商品规格,比如:颜色、规格等商品规格中间表:好理解,商品和规格之间是多对多关联,每种规格会有规格值以及该规格对应的商品图片,比如规格为颜色时,商品的图片可能有白色、黄色等对应规格下的库存及价格表:这个也好理解,比如粉色规格为24*40的枕头对应的库存和零售价,goods_specification_ids为笛卡尔乘积的规格值,可以使用_或者|获取其它任意字符分开,goods_number即为库存,retail_price即为零售价。

This design, the entire product specifications are very flexible, casual collocation, can adapt to the growing commodity specifications, worth thinking about.

At this point, the database design is like this, or quite touched, learned quite a lot of ~

Some thoughts on the design of commodity module database in mall system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.