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
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