background of-mycat of open source database middleware
Now with the development of the Internet, the magnitude of the data is exponential, from GB to TB to PB. The operation of data is becoming more and more difficult, the traditional relational database can not meet the requirement of fast query and inserting data. At this time, the advent of NoSQL temporarily solved the crisis. It gains performance by reducing the security of the data, reducing support for transactions, and reducing support for complex queries.
However, in some cases nosql compromises are not enough to satisfy the usage scenario, for example, some usage scenarios are absolutely business and security indicators. NoSQL is certainly not enough at this point, so it's still necessary to use a relational database. How to use relational database to solve the problem of mass storage? At this point, you need to do a database cluster, in order to improve query performance to spread the data of a database into a different database storage.
What is Mycat?
Mycat behind is Ali once open source of well-known products--cobar. Cobar's core function and advantage is the MySQL database shard, this product has been widely circulated, it is said that the earliest initiator of MySQL is very proficient, later from Ali, Ali then open source Cobar, and maintained to the beginning of 2013, then, there is no then.
Cobar thought and implementation path is really good. Java-based development, the implementation of the MySQL public binary transport protocol, cleverly disguised itself as a MySQL Server, most of the current on the market MySQL client tools and applications can be compatible. It's much wiser to implement a new database protocol than you do, because where the ecological environment lies.
Mycat is based on the evolution of Cobar, the Cobar code is completely reconstructed, using NIO to reconstruct the network module, and optimize the Buffer kernel, enhance the aggregation, Join and other basic features, while compatible with the vast majority of databases become a common database middleware.
Simply put, Mycat is: A new database middleware product, support MySQL cluster, or MARIADB cluster, provide high-availability data shard cluster . You can use Mycat as you would with MySQL. For developers, there is no sense of mycat.
Mycat supported databases:
Be sure to use mycat before using MySQL (which database does not matter, as long as the MYCAT support on the line) simply say Linux under the installation of MySQL:
Installation Requirements:
JDK: Requires JDK to be 1.7 and later
MySQL: Recommended MySQL is more than 5.5 versions
The installation and startup steps are as follows:
(1) Uploading the server and client installation package (RPM) of MySQL
(2) Whether MySQL was installed before query
Rpm-qa|grep-i MySQL
(3) Uninstall the old version of MySQL
RPM-E--nodeps software name
(4) Install the service side
RPM-IVH mysql-server-5.5. 1. linux2. 6. i386.rpm
(5) Installing the client
RPM-IVH mysql-client-5.5. 1. linux2. 6. i386.rpm
(6) Start MySQL service
Service MySQL Start
(7) Log in to MySQL (remember to set the MySQL login password, this is not described in detail here!) )
Mysql-u Root-proot
(8) Setting remote login permissions
' Root '@'%'root'with GRANT OPTION;
Test on local SQLyog connection to remote MySQL
The next job is our play mycat, first of all, of course, from the installation of Mycat.
Mycat's official website: http://www.mycat.org.cn/
①:https://github.com/mycatapache/mycat-download
②:http://dl.mycat.io/
After the download is ready, start the installation:
First step: Uploading mycat-server-1.4-release-20151019230038-linux.tar.gz to the server
Step two: Unzip the compressed package. It is recommended that mycat be placed in the/usr/local/mycat directory.
TAR-XZVF mycat-server-1.4-release-20151019230038-/usr/local
Step three: Enter the bin directory of the Mycat directory and start the Mycat
./mycat Start
Stop Mycat:
./mycat Stop
Mycat supported commands {Console | start | stop | restart | status | dump}
The default port number for Mycat is: 8066
At this time we have successfully installed the Mycat, this is not to worry about how to use the mycat, we need to know how to use Mycat shard to solve the massive data storage solution .
Open Source Database middleware-mycat