In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "the introduction of the method of Mysql sub-database and sub-table". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Why do you want to separate tables:
When the data of a table reaches tens of millions, it takes more time for you to make a query. If there is a joint query, I think you may die there. The purpose of sub-table is to reduce the burden of the database and shorten the query time.
One mechanism in mysql is table locking and row locking to ensure data integrity. Table locking means that none of you can operate on the table until I finish operating on the table. The same is true for row locking, other sql must wait until I have finished working on this data before I can operate on this data.
2. Mysql proxy:amoeba
Do mysql cluster, use amoeba.
From the upper layer of the java program, there is no need to know the source of the master server and slave server, that is, the master-slave database server is transparent to the upper layer. It can be configured through amoeba.
3. A table with a large amount of data and frequently accessed is divided into several tables.
For example, for the database table of a website platform-company table, the amount of data is very large, this can be estimated out of the big data scale, we will divide N tables in advance, how much this N is, depending on the actual situation.
A website now has at most 50 million pieces of data, and each table can be designed to hold 5 million pieces of data, that is, split into 10 tables.
So how to determine whether the data capacity of a table is full? You can do the operation of recording the number of statistical tables before inserting the tables to which you want to add data in the program segment, when
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.