Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction

MyCAT is one of the most popular database middleware written in Java. It is an intermediate service between databases and applications for data processing and interaction. Front-end users can regard MyCAT as a database proxy and access it using the MySQL client tool and command line interface (CLI). Its back-end can communicate with multiple MySQL servers using the MySQL native protocol and communicate with most popular database servers by using the JDBC protocol. The core function of MyCAT is to split a large table into N small tables horizontally and store them in the back-end MySQL server or other databases. In addition, MyCAT leverages the primary/secondary mode of databases to split read and write operations.

MyCAT is suitable for the following service scenarios:

  • The server where the primary database resides is heavily loaded. To enable the secondary database to share some pressure of the primary without modifying the application configuration, you can use MyCAT to configure read/write splitting for the MySQL database, so that you only need to connect the application to MyCAT and MyCAT will distribute SQL statements.
  • A single database server cannot bear any more workload and its drive capacity has reached the bottleneck. To expand the capacity of the database server without migrating the database to a server with higher configuration or modifying the current applications, you can use MyCAT to partition tables in the existing database and route new data to the new database server to implement horizontal expansion of the database.
  • Failover needs to be enabled for the MySQL database, so that when the primary database becomes faulty, all application links are automatically routed to the new primary database without manual intervention. In addition, the database configuration needs to be modified for applications. To achieve this, you can configure failover between the primary and secondary databases in the MyCAT configuration file. In this way, if the primary database fails, the application automatically selects the specified secondary database as the new primary database to provide database services.

Recommended Version

MyCAT 1.6