MyCat MySQL sub-library sub-table of realization

Sub-library sub-table of MyCat achieve

Sub-library sub-table presentation

Sub-library sub-table due to solve the data lead to excessive database performance problems, split into several separate database original database composed of large data table is divided into a number of data tables, such that a single database, a single data table a small amount of data, so as to achieve the purpose of enhancing database performance. With the rise of the micro-architecture of this service, we have a complete application from the application of large, cut into many small applications can provide services independently. Each application has its own database.

Cut into two data points:

Vertical segmentation : be segmented according to the service module, different modules of the cutting table into different databases.

horizontal segmentation : the large table in accordance with a certain segmentation rules, in accordance with the line cut into different tables or different libraries.

vertical

Vertical table definition: the table in accordance with a field into a plurality of tables, each of which stores a portion of the field .
Upgrade it brings is:
1. In order to avoid competition and to reduce the chance of IO lock table to view the details of the user and the product information browse independently of each other.
2. The full operation of the operation efficiency, the hot product information data will not be burdened with high efficiency inefficient commodity description.

Vertical library refers to the table according to the service classification, the above distributed to different databases, each bank can be put on different servers,

Upgrade it brings are:

1. Solve coupling the operational level, a clear business

2. Can be graded for different business data management, maintenance, monitoring, expansion, etc.

Level

Level sub-table is in the same database, a table of the same data according to certain rules split into multiple tables.

Upgrade it brings are:

Table 1. Optimization of large amount of data generated by a single performance issues

2. IO avoid competition and reduce the chance of lock table
level sub-table of the interior, to solve the problem of excessive data of a single table, out of the sub-table contains only a small portion of the data, so that a small amount of data for a single table, improve retrieval performance.

Level sub-library is a table of the same data according to certain rules split into different databases, each bank can be put on different servers.

1. Single library to solve big data, high concurrent performance bottlenecks.

2. improve the stability and availability of the system.
IO stability reflected in the reduction of conflict, locked reduced availability refers to a library problems, partially available.

MyCAT Introduction

Simply put, myCat is:

· A completely open source, enterprise-oriented application development "big database cluster."

Support for the transaction, ACID, can replace the enhanced version of Mysql database

· Enterprise-class database can be viewed as a "Mysql" Clusters, Oracle Clusterware used to replace expensive

· A fusion memory cache, Nosql technology, HDFS large new SQL Server data

· Combination of traditional database and data warehouse generation of new distributed enterprise-level database products

· A new database middleware products

MyCAT goal is : low cost would smooth migration of existing stand-alone databases and applications to the "cloud" side, resolve data bottlenecks in the rapidly growing data storage and scale of business situations.

  MyCAT architecture

 

 

 Key concept

l Schema: specifies the logical database

l Table: logic table

l DataNode: real storage node

l DataHost: real database host

 

 

1.1.1  myCat problems

cross-database join issue

Through business analysis , the different libraries join queries into multiple select

The establishment of a global table (Each library has a same table)

Redundant field (database does not meet the three paradigms)

* ER slicing (the relationship records are stored in a library)

Support for up across two tables across libraries join

l distributed transaction (transaction weak)

Strong consistency Affairs (synchronous)

The final consistency Affairs (asynchronous thought)

l distributed primary key

Redis commands incr

A database (generated primary key)

* UUID

Snowflake algorithm

Mycat problem

mass data storage

Query Optimization

  Mycat support for multiple databases

Guess you like

Origin www.cnblogs.com/wu-yi/p/12133353.html