Distributed database --- sub-library sub-table

Sub-libraries:

Sub-library What do you mean? Your library is a general our experience, to support up to 2000 concurrent, must be the expansion, and a healthy single database concurrency value you best kept at about 1000 per second, not too much. Then you can split the data into a database of multiple libraries, the time of the visit to visit a library better.

Points table:

Sub-table What do you mean? It is a table of data into multiple tables, and then query when you check a table. Such sub-table according to user id, to a user in a data table. Then, when the operation of the operation that you would like a table for a user. This can control the amount of data in each table in the controllable range, such as within each table is fixed 2,000,000.

What used sub-library sub-table middleware?

cobar, TDDL ,mycat。

How the database how to split vertically or horizontally split?

   Split level meaning: is to get data from one table to multiple tables multiple libraries to go, but the table structure of each library are the same, but put the data in each database table is different, all libraries data tables add up all the data. Meaning split level, it is to put even more data library, and then use multiple libraries to carry higher concurrency, there is a library with more storage capacity to carry out the expansion.

  Vertical Split means: that is, a lot of the table column to be split into multiple tables, or a plurality of up library. The structure of each database table is different, each library table contains some of the fields. In general, the fewer will visit a high frequency field into a table to go, then more low access frequency field into another table to go. Because the database is cached, high frequency line field you access the less, it can cache more lines, the better the performance in the cache. This is generally done more some of the tables level.

How many single table of data to reach time will affect the database query performance? why?
A: Generally mysql reach 100w, affecting database query performance,

Sub-library sub-table in the vertical banking scheme will bring what issues?
A: The amount of data in a single table will still be great.

Distributed data storage middleware such as what is the core processes mycat?
A: Analytical interception sql -> Data Source Assignment -> request response -> Integration Results

Mycat after sub-library sub-table, it is how to support contingency table queries?

ER use good table, add annotations on the sql, with a global table.

Mycat middleware principle?

  When Mycat receive a SQL, SQL will first resolve this, look-up tables involved, then look at the definition of this table, if partakers sheet rule is to get the value in SQL fragmented field and match fragmentation functions, get a list of the corresponding SQL fragments, and then sent to the SQL to perform these fragments, the final results of the data collection and processing all fragments returned, and output to the client.

To select * from Orders where prov =? Statement, for example, found prov = wuhan, in accordance with the fragmentation function, wuhan return dn1, then it is sent to SQL MySQL1, to get results on DB1, and returned to the user.

Guess you like

Origin www.cnblogs.com/lgg20/p/12329186.html