I'm curious, and I'd like to ask someone to help me. How should I design the order data table for a large shopping volume website like Taobao?
何惜一博
何惜一博 2019-03-29 17:53:28
0
2
1456

Sorry, I have never done a large website, and I am still not very proficient in databases

If the shopping table has hundreds of billions of data, what should be the appropriate value for the primary key id?

But since Taobao has developed so far, how has so much Taobao order data been stored? Such a huge amount of data?

Please give me the answer

何惜一博
何惜一博

reply all(1)
秋香姐家的小书童

There are several ways

1. For example, divide the order number into 10 libraries according to the last number 0-9. When querying the order, just write a small algorithm to match which database it is. One library and one database server

If the amount of data is 10 million Then it becomes a database with one million pieces of information. In this way, the pressure on the database is almost gone

2. If the amount of concurrency is particularly large, then divide each database into N tables. Example: Divide every 500,000 pieces of order number information into one table. Assuming 1 billion pieces of information, then one table only has 2,000 pieces of data.


I don’t know if you understand the design of the database structure I’m talking about

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!