This article was transferred from: HTTPS://WWW.JIANSHU.COM/P/9F1347EF75DD
2013 Ali's Cobar in the community using the process found that there are some serious problems, such as high concurrent death, heartbeat connection failure, only half of the NIO, and the seemingly beautiful automatic connection let us in the use of the process fell into one after another trap, struggling. Finally, after the MYCAT leader Leader.us's improved--mycat was born.
After Mycat open source, some Cobar users took part in the development of Mycat, and eventually Mycat developed into a community-based open source software maintained by the strength architects and senior developers of many software companies.
In 2014 Mycat for the first time in Shanghai's "Chinese Architects" conference to preach, more people to participate in, and then more and more projects to adopt the MYCAT.
In May 2015, the first official authoritative guide, the Mycat authoritative guide, was written by core participants, with more than 500 copies, and became the pioneer in open source projects.
As of October 2015, the MYCAT project has a total of 16 committer.
As of November 2015, more than 300 projects were mycat, covering banking, telecommunications, electronic singing, logistics, mobile applications,
Many areas and companies.
As of March 2016, more than 6,000 users were added to the group or research to discuss or test or use Mycat.
Mycat is based on the evolution of open source Cobar, we have completely reconstructed the code of Cobar, reconstructed the network module with NIO, optimized the buffer kernel, enhanced the basic features of aggregation, join, and compatible with most databases to become the common database middleware. After the 1.4 version completely out of the basic Cobar core, combined with MYCAT cluster management, automatic expansion, intelligent optimization, become high-performance middleware. We are committed to developing high-performance databases in the middle. Never charge, never close the source, continue to promote the development of open source community.
Mycat What is it?
From the definition and classification, it is an open source distributed database system, is a server that implements the MySQL protocol, the front end user can think of it as a database agent, with the MySQL client tool and command line access, and the backend can use the MySQL native protocol with multiple MySQL server communication, You can also use the JDBC protocol to communicate with most major database servers, the core function is to separate the partition of the table and read and write, a large table is divided into n small tables, stored in the back-end MySQL server or other database. You can also specify multiple write libraries for multiple read libraries.
Mycat Development to the current version, is not a simple MySQL agent, its backend can support MySQL, SQL Server, Oracle, DB2, PostgreSQL and other mainstream databases, but also support MongoDB this new NoSQL mode of storage, More types of storage will also be supported in the future. And in the end user's view, no matter is that storage way, in Mycat, is a traditional database table, supports the standard SQL statement to carry on the data operation, thus, to the front-end business system, can greatly reduce the development difficulty, enhances the development speed.
By falling feather into frost
Why use Mycat?
1. Too many connectivity issues, all data sources can be managed centrally through MYCAT, and the backend DB cluster is transparent to the front-end application.
Before using Mycat. Concern number architecture designers see more dry goods
Mycat after the transformation. Focus on architecture designers see more dry goods
2. Original ER-relational shard, solve the problem of e-r fragmentation , the parent-child table with association relationship in the process of data inserting, the child table is routed to the node of its related parent table record, so that the parent-child table's join query can be pushed down to the individual database nodes. This is the most efficient cross-node join processing technology, but also the MYCAT initiative.
Focus on architecture designers see more dry goods
3. Using global sharding Technology, each node concurrently inserts and updates data, each node can read data , improve read performance, but also solve the efficiency of cross-node join.
Focus on architecture designers see more dry goods
4. Catlet supports cross-shard complex SQL implementations and stored procedure support through AI. the method of use is mainly performed by Mycat annotations, as follows:
(1) Cross-shard Federated query Annotation Support:
/*! Mycat:catlet=demo.catlets.sharejoin/select Bu., sg.* from Base_user bu,sam_glucose sg where bu.id_=sg.user_id;
Note: Sam_glucose is a cross-shard table.
(2) Stored procedure annotations support:
/*! Mycat:sql=select * from Base_user where id_=1;*/call Proc_test ();
Note: The current execution of stored procedures is performed by Mycat annotations, noting the need to write the SQL in the stored procedure to the annotations.
(3) batch insert with ID self-growth combined support:
/*! Mycat:catlet=demo.catlets.batchinsertsequence */INSERT INTO sam_test (name_) VALUES (' T1 '), (' T2 ');
Note: This method does not need to be displayed in the SQL statement to set the primary key field, the program in the background according to the PrimaryKey configuration of the primary key column, automatically generate the sequence value of the primary key and replace the relevant columns and values in the original SQL;
(4) Get support for batch sequence values:
/*! Mycat:catlet=demo.catlets.batchgetsequence */select mycat_get_seq (' mycat_test ', 100);
Note: This method represents getting the 100 sequence values of the Mycat_test table, for example, the maximum sequence value for the current Mycat_test table is 5000, and 5001 is returned in this way, while the mycat_ in the database is updated The test table has a maximum sequence value of 5100.
(5) Better support for database read and write separation and high availability, MYCAT supports advanced read/write separation control based on MySQL master-slave replication state (e.g. Slave_behind_master <100 is turned on), and once master-slave synchronization error is detected or latency exceeds development, The readhost is automatically excluded, preventing the program from reading old data for a long time.
Mycat Next Step planning
Strengthen the function of distributed database middleware, so that it has rich plug-ins, powerful database intelligent optimization function, comprehensive system monitoring ability, and convenient data operation and maintenance tools, realize online data expansion, migration, things and other advanced functions.
Mycat attracts and gathers a large number of senior engineers in the field of big data and cloud computing, Mycat's development is based on the continuous efforts of the open source community volunteers, thanks to the efforts of community volunteers to make mycat more powerful, and we also welcome more volunteers to participate in MYCAT development, Together to promote the development of the community, to provide better open source middleware for the program world.
MYCAT Official website: http://www.mycat.io/
Mycat Source: Https://github.com/MyCATApache/Mycat-Server
Mycat:https://github.com/mycatapache/mycat-download
Feather into Frost,
Links: https://www.jianshu.com/p/9f1347ef75dd
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Distributed Database Middleware Mycat Company aims Yangzhou data storage (RPM)