Home > Article > Backend Development > [Product Design] E-commerce design Zhihu summary, product design e-commerce summary_PHP tutorial
If you want to build a B2B2C e-commerce platform, what issues should you pay attention to when setting up background data statistics? How to design a specific statistical module?
Wang Yuping:
I think that before building a database, you need to design the requirements and processes. With the requirements in this step, you will know what data you need here; with the process, you will know what data you need here. What data can be obtained, even the data type.
For example, in supplier management, you will get the supplier’s company region, phone number, category, etc. In data statistics, you can make statistics on region and category, and then based on C’s corresponding demand recommendations, etc.
PalmWong:
It is recommended to start with business understanding:
BBC platform is first divided into three backends
Merchant Portal Platform Operation Portal Buyer Personal Portal
The parts to be counted are also three pieces:
1, from the personal perspective of consumers: personal consumption statistics
2, from the perspective of platform operation: statistics on the operation of the entire platform, statistics on the operation of merchants
3, statistics from the perspective of merchants
BBCThe mall is actually a very complex business system. Due to changes in roles and functions, there are actually a lot of data interactions. There are many exceptions in reconciliation, statistics, and authority management.
You can’t just look at Tmall’s mode and just close your eyes.
Use PHP MySql to build a Taobao mall with tens of millions of users and visits B2C website, how about it?
Dion:
System architecture is very important!
Language:
There is no problem with mainstream languages. PHP, Java, whatever.
Front-end server:
If conditions permit CDN, best. If not, be sure to ensure the load performance of the front end. Generally recommendedNginx.
Application Server:
Cluster. The front end is responsible for load balancing. For clusters, just pay attention to the problem of Session. Nothing else.
Data storage:
If the amount of data is relatively large (millions), it is no problem to use MySQL Memcached to build a cluster.
If the amount of data is large, consider NoSQL. For example, Facebook uses Cassandra, Amazon uses Dynamo .
socici:
You can be simpler and look at it from the perspective of data accessed by users
Static files, including pictures, HTM , JS, css These are data that do not change frequently. Give a separate domain such as http://static.xxxx.com by nginxManagement
The dynamic data released through the front and backend is divided into the following types:
Data read:
1.For big data that users need to query, such as orders, you can check the database of slaver
2.The data displayed on the system public page, such as some product information, rankings, etc. can be retrieved from the cache
Data written:
If it is required to take effect immediately, such as modifying user information, write it directly to the master database
Things that have low real-time requirements or have concurrency restrictions, such as posting Weibo, sending private messages, etc. Write to the queue first, then read and save asynchronously to the database
The problem of product specification design in the e-commerce platform has been thrown out. Please comment?
Product list (product name, price, shelf availability and other basic information)
For example: 1, Mobile phone, 100
Specification table (primary key, productID, specification name )
For example: 1 , 1, operator
Product specification value table (primary key, specificationID, productID, specification valueID, specification valueNAME)
For example: 1, 1, 1, 0, Telecom version
2, 1, 1, 1, mobile version
Specification inventory table (itemID, specification valueID combination, specification value NAMEcombination, inventory, price)
For example: 1, 1/0 (Operator, Telecom version) , operator /telecom version, 100, 100 Block
Problem description:
The above method can achieve multiple specifications and multiple inventories, but using an agreed specification order makes it painful for the system to count data related to different specifications in the later stage when writing a program.
And when creating a product, you must first create the product before you can create specifications. I personally refer to some large e-commerce platforms and found that product creation is completed with one submission.
Help needed:
I need to give a reasonable product design with multiple specifications, multiple prices, and multiple inventories based on my problem description, to solve my programming complexity, and at the same time ensure that I can create interactive products in the interactive design. Simple.
socici:
Product Category (typeid,type name, parentID)
Product list (product name, price, shelf availability and other basic product information, product classification)
Specification table (primary key, specification name )
Specification value table (Specification valueID, Specificationid, rule value type, specification default value)
Specification-Category association table (product categoryid, specificationid)
Product-Specification Association Table(Productid,Specificationid,Specification valueID,Specification actual value)
Inventory table (itemid,quantity,price)
How is a database similar to Taobao’s product details page stored?
1, the number of pictures and the number of introduction paragraphs for each product are not fixed , is After editing with the editor, will the entire html be stored in the database? Not realistic?
2. If stored as database fields, number of pictures and introduction paragraphs for each product The number is not fixed ,Even if you set an upper limit,, it will waste a lot of fields
3.When querying ,If the picture and introduction text are stored separately , So how do you match a certain picture with a question about introducing it when the page is displayed after querying
Liu Chuanshuang:
Overall
1. The structured information of the product is stored in the database, including name, price, inventory, attributes, etc. Of course, it is not a simple table.
2. The unstructured information of the product is saved into small files and stored in a self-developed massive small file system, including pictures and product description information.
3, product image file id needs to be stored in a database or other types of storage, and does not necessarily require multiple fields. This is a horizontal method. Generally, a picture of a product is stored as a record and expanded vertically.
4. Before saving the document, save the image first, and put the image in the document Src address is replaced with the image path in the small file system, and that’s it
In addition, storage cannot be understood as only databases and file systems. There are various types of storage, different file systems, various RDBMS, NoSqlStorage...
Zi Liu:
Actually, several colleagues have already answered, so I will add something from a historical perspective
The earliest this field was indeed placed in the database was a clob field, which stored html fragment. Moreover, at that time, this field was in the same table as the product title, price, seller ID, etc. It is conceivable how much the performance would be affected.
So this method is destined to not last long. In 2005, I separated this field into a separate table to store it. This does not require much technology. content, it relieved a lot of pressure on the database at that time, and the DBAswere very grateful to me. After 2006, Taobao began to use caching on a large scale. This field was also put into the cache, which reduced a lot of pressure on the database. (Only data that is not in the cache is read from the database, and it is put into the cache after being read). In 2007, Taobao developed a distributed file storage system TFS, so this was completely The fields are extracted from the database, along with large field information such as transaction snapshots.