MyCat
What is MyCAT?
Official Website: http://www.mycat.org.cn/
Simply put, myCat is:
· A completely open source, enterprise-oriented application development "big database cluster."
· Support Services, the ACID, can replace the enhanced version of Mysql database
· A can be considered enterprise-level database "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
1.1.1 myCat architecture
1.1.2 Core Concepts
the Schema L : logical database specified by its
the Table L : logic table
DataNode L : real storage node
DataHost L : real database host
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:
l Vertical segmentation : be segmented according to the service module, different modules of the cutting table into different databases.
l 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 defines : a table in accordance with the field into a plurality of tables, each of which stores a portion of the field .
Upgrade it brings are :
1. To avoid the IO competition and reduce the chance of 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. capable of data from different service level 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 :
1. Optimization of the single table of data generated by excessive performance issues
2. Avoid IO competition and reduce the risk of the 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. resolve to a single data repository large, high concurrent performance bottlenecks.
2. improve the stability and availability of the system.
Stability reflected in the IO reduce conflict, reduce lock, availability refers to a library problems, partially available.
1.1.3 myCat problems
l 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 incr command
* A database (generated primary key)
* UUID
* Snowflake algorithm
Mycat problem
l mass data storage
l Query Optimization
1.1.4 myCat support for multiple databases